3 ms·
You can achieve that with any view library which can rehydrate from a server-rendered version and can support your minimum list of requirements. The specifics d
by insin 9y ago
You can achieve that with any view library which can rehydrate from a server-rendered version and can support your minimum list of requirements. The specifics depends on the libraries you're using.
I was experimenting with this [1] a couple of years ago with React, react-router and a form library based on django.forms. The key was to handle form submission in components which behaved like they were servicing a request on both sides, passing in the POST body on the server or form data extracted in the same format on the client.
There's some not-so-fun plumbing to make sure everybody has the data they need to re-render with user input and validation errors when they happen, and to handle redirect-after-submit properly on both sides, but I initially had to hack some of the necessary plumbing into a pre v1.0.0 react-router so the specifics are probably no longer relevant.
[1] https://isomorphic-lab.herokuapp.com https://isomorphic-lab.herokuapp.com