Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

do you just not use react state at all then? I have a similar sized app as you, we started off naively using state at various levels, over time we refactored the state higher and higher, and now we are at the point where all the state is kept only at the root of the view hierarchy (we use cursors). We're about one step away from lifting even that state out of react and into a store layer that has no react dependencies.


That's about right. We really only use state for transient display properties, mostly toggling display of some component.


> (we use cursors)

I'd love to hear some more about the design of your data store: are these cursors basically paths to data? Are they similar to Om's concept of cursors? https://github.com/swannodette/om/wiki/Cursors


Yes, like Om. Cursor is a read/write view of a subtree of an immutable tree.

https://github.com/wingspan/wingspan-cursor/blob/master/js/C...


We do still use React state, especially for view state like whether a piece of text is expanded or whether the viewer has toggled the grid or list view on a table. But as you said, most of our data is pulled into a store layer that doesn't have React dependencies.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: