Skip to content

Instantly share code, notes, and snippets.

@jschr
Last active April 12, 2017 04:15
Show Gist options
  • Save jschr/b91093ed88b30b4a5cb833ea2109f98a to your computer and use it in GitHub Desktop.
Save jschr/b91093ed88b30b4a5cb833ea2109f98a to your computer and use it in GitHub Desktop.
glamor mount
import * as React from 'react'
import { render } from 'react-dom'
import { rehydrate } from 'glamor'
export default function () {
const ssr = (window as SSRWindow).ssr
rehydrate(ssr.cssIds)
// use require to ensure glamor rehydrate is called
// before styles are created
const App = require('./components/App').default
render(<App {...ssr.appProps} />, document.getElementById('react-root'))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment