SSR working
This commit is contained in:
13
src/main-server.jsx
Normal file
13
src/main-server.jsx
Normal 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>
|
||||
);
|
||||
|
||||
@@ -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>,
|
||||
|
||||
Reference in New Issue
Block a user