SSR working

This commit is contained in:
Pierre Martin
2021-01-29 05:00:49 +01:00
parent 457e7a09f6
commit 3dc3668967
5 changed files with 37 additions and 24 deletions

13
src/main-server.jsx Normal file
View File

@@ -0,0 +1,13 @@
import React from 'react'
import ReactDOM from 'react-dom/server'
import './index.css'
import App from './App'
console.log('hello');
export const render = (url) => ReactDOM.renderToNodeStream(
<React.StrictMode>
<App />
</React.StrictMode>
);

View File

@@ -3,8 +3,7 @@ import ReactDOM from 'react-dom'
import './index.css'
import App from './App'
console.log('hello');
ReactDOM.render(
ReactDOM.hydrate(
<React.StrictMode>
<App />
</React.StrictMode>,