by Austin Malerba
奥斯汀·马勒巴(Austin Malerba)
引入react-use-database:客户端关系数据变得更加容易 (Introducing react-use-database: client-side relational data just got easier)
An issue that’s plagued React apps everywhere: after updating a resource on the server, how do I update my UI state to reflect the changes?
一个到处都困扰着React应用的问题:更新服务器上的资源后,如何更新我的UI状态以反映更改?
Typically there are two solutions:
通常有两种解决方案:
- Use the app’s existing data-fetching mechanisms to reload the data (essentially refresh the page on the user’s behalf) 使用应用程序现有的数据获取机制来重新加载数据(实质上代表用户刷新页面)