Hacker News new | ask | show | jobs
by frigen 3213 days ago
True, but ideally the framework would lead programmers automatically to ways of doing things in the "right way" instead of overusing local state.

A "better react" would make it natural and obvious to use store versus local state in the appropriate way.

1 comments

Well, that's not really the idea behind React. You could say local storage is more a convenience than anything, React is primarily about rendering your data.

The problem is that, with Redux at least, composing data stores is a major pain. The only pattern supported out-of-the-box is horizontal slicing (have different reducer for separate pieces of data). This may work for separate pages, but it does nothing for you as soon as you need data sharing. I don't think React itself should change, but I haven't found a really satisfactory solution to the problem of sharing stored data.