https://github.com/lazopm/react-static-content
optimized react server rendered static content (proof of concept)
https://github.com/lazopm/react-static-content
javascript react server-side-rendering
Last synced: 2 months ago
JSON representation
optimized react server rendered static content (proof of concept)
- Host: GitHub
- URL: https://github.com/lazopm/react-static-content
- Owner: lazopm
- Created: 2017-11-19T20:24:55.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-24T09:01:29.000Z (over 7 years ago)
- Last Synced: 2025-11-04T18:22:40.369Z (5 months ago)
- Topics: javascript, react, server-side-rendering
- Language: JavaScript
- Homepage:
- Size: 52.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Static Content
Sometimes we have large pieces of static content in our application state, such as articles, user comments, or most content coming from a CMS.
Traditionally when server-side rendering, the initial HTML has two copies of this content, one in the markup and one in a script tag for rehydration.
This is a proof of concept for a way to rehydrate static content in the client without having the state needed to render it.
```javascript
//server
ReactDOMServer.renderToString(
);
//client
ReactDOM.rehydrate(
,
document.getElementById('root'),
);
```