3 ms·
This is why they gave the presentation on Flux, which is architecturally how Facebook solves this problem. Basically the first principal you must learn is to f
by natmaster 12y ago
This is why they gave the presentation on Flux, which is architecturally how Facebook solves this problem.
Basically the first principal you must learn is to find the lowest common ancestor to store state. (http://facebook.github.io/react/blog/2013/11/05/thinking-in-react.html http://facebook.github.io/react/blog/2013/11/05/thinking-in-...) After realizing this the immediate thing people do is pass call backs through children so grandchildren's actions can communicate with where the state is. This leaks through all the components however, which is why Flux separates actions out into something that all the components have access to.
- insin 12y agoWorth pointing out that you don't need a full Flux implementation to get the benefits of going sideways to an action module: https://github.com/ryanflorence/react-training/blob/gh-pages/lessons/04-less-simple-communication.md https://github.com/ryanflorence/react-training/blob/gh-pages...