Avoiding useEffect when data changes
How would you handle data from the server changing, based upon which local state should change too?
The code below "works" but I would like to avoid useEffect, since I feel like it isn't really the right tool for what I want.
So what is the general pattern for how to make changes in server side data affect client side state?
In other words: I have a derived value from the cache that should be able to change on the client side and optionally the user has a post button to update the server side data.
The code below "works" but I would like to avoid useEffect, since I feel like it isn't really the right tool for what I want.
So what is the general pattern for how to make changes in server side data affect client side state?
In other words: I have a derived value from the cache that should be able to change on the client side and optionally the user has a post button to update the server side data.