-
serialize-javascript
Serialize JavaScript to a superset of JSON that includes regular expressions and functions.
-
blogpost-example-react-ssr
Loading the right data on the server-side with respect to nested components, react-redux (and react-router)
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
We pass the entire state to the client-side via a script tag in the html document by using the serialize() function in the serialize-javascript package. (This javascript parser allows us to parse more object types like a Date so I would recommend to use that package instead of the JSON.stringify() function.) On the client-side we can now read the window.initialState object and parse it to the Redux store.
While tackling this problem we are going to use the express package as our webserver and use React’s renderToString() method to render all the components on the server-side.