4 ms·
I'm not sure I'd agree that those are examples of people fighting React though — using it on the client and server allows you to never duplicate markup you migh
by straws 11y ago
I'm not sure I'd agree that those are examples of people fighting React though — using it on the client and server allows you to never duplicate markup you might have in a component with markup in a template, for example. The case for writing your entire UI in React is pretty strong actually, as it's just a matter of where you create the data to pass down to your tree of components: once, on the server for a complete page load, or incrementally and dynamically on the client.
There are some cases though where the component model feels strained — consider components that act as a pass-through for debouncing data, components that implement routing as a tree of routes and handlers, or components that perform data-fetching. Perhaps it's that the community hasn't found the right APIs for these higher-order components, but it's hard to argue against using React for a stateless tree of UI components.