How to write a react state management framework?

as the title

in fact, there are two major problems that need to be solved:

1. Extract the data into store and monitor the data. You can use Object.defineProperties or Proxy

2. You need to notify the component to update

if the data changes.

if you want to achieve a good state management, how should you design it? How to update the corresponding components after the data has changed?

use react context , the 15.x version is not recommended, 16.x syntax changes too much, unstable things are not applicable as far as possible.

Please give me advice from the great gods

May.14,2021

I don't know why I wrote it myself

I think we can use off-the-shelf redux mobx

in addition, the Nuggets have several articles that rewrite status management
you can search

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2bfd9-2b257.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2bfd9-2b257.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?