Created
September 8, 2018 16:44
-
-
Save danielnmai/d41d1f83e264135f499f1dfc26fe8bdc to your computer and use it in GitHub Desktop.
Root file for client side
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { hydrate } from 'react-dom' | |
import App from './App.js' | |
import ContextProvider from './ContextProvider.js' | |
const context = { | |
insertCss: (...styles) => { | |
const removeCss = styles.map(x => x._insertCss()); | |
return () => { | |
removeCss.forEach(f => f()); | |
}; | |
}, | |
} | |
hydrate(<ContextProvider context={context}> | |
<App /> | |
</ContextProvider>, document.getElementById('app')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment