Let's be real. It's 2015 and we need quite some hoops to get, in most cases, some very simple data rendered on the screen. And even with all those hoops, we are still not sure that it works in all cases. Isn't it time for better tools than react? Like functional languages that support incremental computation?
React Tips and Best Practices
31–40 of 42 posts
Re: React Tips and Best Practices
#32One of the things I didn't realize at first was the degree to which Relay/GraphQL appear to effectively replace a lot of Flux: http://facebook.github.io/react/blog/2015/02/20/introducing-... Learning Flux sort of seems like learning how to drive stick shift on an '97 Civic while we wait for the new Tesla to arrive - useful, also a bit annoying. A central store architecture does seem a better match to what Relay will…
Don't forget that Relay means replacing your RESTful routes. If you still want to work with RESTful endpoints, you are going to work with Flux.
Re: React Tips and Best Practices
#33Let's be real. It's 2015 and we need quite some hoops to get, in most cases, some very simple data rendered on the screen. And even with all those hoops, we are still not sure that it works in all cases. Isn't it time for better tools than react? Like functional languages that support incremental computation?
Can you (or someone else) explain the need for the language to be functional?
It seems like the more one uses React, the more they crave the above, so it makes sense to use an environment where all of the above is natural.
Re: React Tips and Best Practices
#34What are the best resources for someone looking to learn react and jsx?
Quite seriously: http://facebook.github.io/react/docs/getting-started.html
Re: React Tips and Best Practices
#35Earlier quoted context omitted.
Don't forget that Relay means replacing your RESTful routes. If you still want to work with RESTful endpoints, you are going to work with Flux.
Exactly -- nobody (yet) has written any kind of general purpose mapping from rest concepts to relay endpoints. Relay appears to leverage graph db functionality/semantics pretty heavily.
Re: React Tips and Best Practices
#36Edit: Turns out my render methods aren't pure. I query stores right render, which causes problems when using this mixin.
Re: React Tips and Best Practices
#37With PureRenderMixin, doesn't that also prevent child components from updating in response to state changes? For example if a child component must update due to some event, but none of its parents care about that event, doesn't that cause the child not to update? Edit: Turns out my render methods aren't pure. I query stores right render, which causes problems when using this mixin.
http://facebook.github.io/react/docs/advanced-performance.ht... has the best description of this process I've found so far.
Re: React Tips and Best Practices
#38With PureRenderMixin, doesn't that also prevent child components from updating in response to state changes? For example if a child component must update due to some event, but none of its parents care about that event, doesn't that cause the child not to update? Edit: Turns out my render methods aren't pure. I query stores right render, which causes problems when using this mixin.
Re: React Tips and Best Practices
#39With PureRenderMixin, doesn't that also prevent child components from updating in response to state changes? For example if a child component must update due to some event, but none of its parents care about that event, doesn't that cause the child not to update? Edit: Turns out my render methods aren't pure. I query stores right render, which causes problems when using this mixin.
This keeps your child components pure (fast, renders directly from props, uses PureRenderMixin) and keeps data access centralised to the nearest common controller-view component. It's okay to have a parent component that simply collects data to pass directly into a single child within the render() call — the parent fetches data and sets props, the child re-renders only when the props update, and there's a clear separation of responsibility between the two.
Re: React Tips and Best Practices
#40Let's be real. It's 2015 and we need quite some hoops to get, in most cases, some very simple data rendered on the screen. And even with all those hoops, we are still not sure that it works in all cases. Isn't it time for better tools than react? Like functional languages that support incremental computation?