Dynamically import netlifyIdentity

This commit is contained in:
Jinksi 2017-10-14 11:34:41 +10:00
parent 7a6d9dd223
commit 522b9a694d
3 changed files with 4 additions and 2 deletions

View file

@ -19,6 +19,7 @@ export const siteTitle = 'HyperStatic'
class App extends Component {
componentWillMount () {
globalStyles()
import('./netlifyIdentity')
}
render () {

View file

@ -2,7 +2,6 @@ import React from 'react'
import { render } from 'react-snapshot'
import App from './App'
import registerServiceWorker from './registerServiceWorker'
import './netlifyIdentity'
const rootEl = document.getElementById('root')
render(<App />, rootEl)

View file

@ -9,4 +9,6 @@ netlifyIdentity.on('init', user => {
}
})
netlifyIdentity.init()
if (window.localStorage) {
netlifyIdentity.init()
}