-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data fetch in react #337
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
react 中的异步数据获取似乎要迎来一些变化了。
这意味着,React 将提供官方 API,让框架和用户使用,实现组件渲染时,能够同步读取 Promise 中结果的效果。这具体意味着什么呢?我基于别人的一个 demo,自己改了改,实现了一个最简单的 cache + prefetch + 同步渲染 Promise 的效果。
具体见:https://codesandbox.io/s/suspense-use-demo-forked-from-zustand-suspense-demo-dq3i7h-yd3vlg?file=/src/App.js
未来大概的局面是,prefetch 成为标配,loading 管理变得轻松,大量无效 loading 不再出现,必要的 loading 真正发挥作用,而不是有碍观瞻,无脑 loading。
The text was updated successfully, but these errors were encountered: