mirror of
https://github.com/kremalicious/portfolio.git
synced 2024-12-22 09:13:19 +01:00
add react-snap
This commit is contained in:
parent
bf8165a366
commit
a7376f23fd
@ -17,6 +17,7 @@
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-plugin-react": "^7.7.0",
|
||||
"jest-cli": "^22.4.3",
|
||||
"react-snap": "^1.11.5",
|
||||
"stylelint": "^9.1.3",
|
||||
"stylelint-config-standard": "^18.2.0"
|
||||
},
|
||||
@ -31,6 +32,7 @@
|
||||
"build-js": "react-scripts build",
|
||||
"build": "npm-run-all build-css build-js",
|
||||
"test": "npm run lint && react-scripts test --env=jsdom",
|
||||
"eject": "react-scripts eject"
|
||||
"eject": "react-scripts eject",
|
||||
"postbuild": "react-snap"
|
||||
}
|
||||
}
|
||||
|
16
src/index.js
16
src/index.js
@ -1,14 +1,16 @@
|
||||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import { hydrate, render } from 'react-dom'
|
||||
import { BrowserRouter as Router } from 'react-router-dom'
|
||||
import './index.css'
|
||||
import App from './App'
|
||||
import registerServiceWorker from './registerServiceWorker'
|
||||
|
||||
ReactDOM.render(
|
||||
<Router>
|
||||
<App />
|
||||
</Router>,
|
||||
document.getElementById('root')
|
||||
)
|
||||
const rootElement = document.getElementById('root')
|
||||
|
||||
if (rootElement.hasChildNodes()) {
|
||||
hydrate(<Router><App /></Router>, rootElement)
|
||||
} else {
|
||||
render(<Router><App /></Router>, rootElement)
|
||||
}
|
||||
|
||||
registerServiceWorker()
|
||||
|
Loading…
Reference in New Issue
Block a user