4 ms·
If you are then re-using the same React code on the client side (and you generally are), then of course it does. This is the enticement of "universal" framework
by azangru 8y ago
If you are then re-using the same React code on the client side (and you generally are), then of course it does. This is the enticement of "universal" frameworks — you use the same code (perhaps with occasional slight modifications here and there) to run on the server side and on the client side. Imagine your Symfony, Django or Rails app that runs not only on your server, but in your browser as well. That’s roughly the luxury that server-side React (or Angular Universal, or Vue, etc.) gives you.
- z3t4 8y agoComponent reuse would be a selling point. But what about stateful components that change colour or what not, do they still run on the client side? And what about a todo-list like the one on the react start page, will it "magically" use hidden forms and make http posts to update the server state ?
- azangru 8y ago> what about stateful components that change colour or what not, do they still run on the client side Yes :-) Statefulness of a component is not useful for server-side rendering anyway, because component state will only change on the client side. But yes, stateful components work both client-side and server-side. > And what about a todo-list like the one on the react start page, will it "magically" use hidden forms and make http posts to update the server state I am not sure what you mean. Filling in and submitting a form only makes sense on the client side. It can be pre-populated with data during server-side rendering though. Naturally, http requests for form submission will work on the client.