DEV Community

Discussion on: Pullstate - Simple hooks-based state management for React

Collapse
 
jamesthomson profile image
James Thomson

Looks interesting, might have to check it out. The use of selector to minimize re-renders is a nice feature. We found Contexts to be useful in certain circumstances, but could create a lot of overhead due to re-renders if the Context tried to handle too many things. We've been using Zustand lately which Pullstate looks to be quite similar to. Big fan of the transient updates and selectors.

Collapse
 
daviddalbusco profile image
David Dal Busco • Edited

Same feeling here, I used Zustand in two recent apps, it looks kind of similar (simple small state management, async friendly and powered by nice hooks).

That being said, doesn't mean I should not give Pullstate a try for a next project 🤙.

Collapse
 
maxlynch profile image
Max Lynch

Thanks James, Zustand does indeed look very similar, will check it out. re: Context API, yes I've found that poor implementations using the Context API can have unintended performance issues. It's tempting to try to just use plain React for state management but in this case I find these simple libraries reduce the custom code you need to write quite a bit and have the added benefit of avoiding those unnecessary re-renders

Collapse
 
jamesthomson profile image
James Thomson

In our experience it was less poor implementation and more misconception. It sounded like a replacement for state management at a Redux level (Context API + reducers). The part that was (and still seems to be) missing from the official docs is the fact that any change within the contexts state will have a knock-on effect. That seems like a pretty important piece of information not to mention.