5 ms·
> There's no official path from view layer -> complete app (no guidance for data flow, how to communicate with the server, server side rendering, routing on the
by mason55 10y ago
> There's no official path from view layer -> complete app (no guidance for data flow, how to communicate with the server, server side rendering, routing on the client).
Every time I've decided to take an afternoon to poke at React this is where I've given up. I totally understand the model and appreciate how useful it can be but I've never been clear about how to actually hook it up to a backend that isn't just the generated demo scenario and what the requirements for my backend would be.
- scarlac 10y agoI think this is common. For me the front page and JSX threw me off. React was so un-opinionated that it can loose its appeal when it presents itself. Once I took an opinionated tutorial it became much clearer to me. Since then I've used React in conjunction with Django, PHP/Laravel, converted large jQuery codebases to React and created frontend-only sites. I've not yet gone full-on with a NodeJS back-end and isomophic and that's fine for now. Pass your data into a root component via props. Or use XHR requests to load data from your backend into your root component and manipulate them in your state. Let the data changes in the root component trickle down via props. Keep it simple with React loaded via a <script> tag and work from there.
- k3liutZu 10y agoNo, that becomes a nightmare to maintain. Use Redux and connect any component that needs data to the store and get the data needed directly.
- tptacek 10y agoNot much more to say about this than that I do not agree, that I think flux-alikes are overused, and that it's just as easy to go too far the other direction, where nothing has any state even for trivial UI state concerns.
- danabramov 10y agoAgreed.
- ec109685 10y agoIt seems like an afternoon is an awfully short time to allot to try a new framework / approach. I have definitely found lots in the Frontend world extremely frustrating at first given there are so many ways to do something, but it eventually clicks and makes sense.