Skip to content
Discussion options

You must be logged in to vote

Ok, I did some deep thinking, and came up with - I think - a much better approach.

I hate to say it, but I did end up kicking out Zustand with this approach. With that said, it's pretty incredible, and makes state management as easy as mutating plain JSON in Javascript. It uses a tree of proxies, tracks 'get' requests while rendering, and triggers re-renders when 'set' is triggered in the proxies.

The only requirement is to wrap functional components that use state with a new reactive function, similar to React's memo or forwardRef functions.

I re-implemented the same app as before using the new system.

As you'll see, modifying state is as easy as pushing / splicing arrays, assigning prop…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by CodeSmith32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant