react-style-side-effect
v0.1.0
Published
React Style Side Effect =========================
Downloads
2
Readme
React Style Side Effect
Declaritvely style elements that exist outside of the React tree. Works great with css-in-js libraries such as:
Installation
npm install --save react-style-side-effect
Basic Usage
import React from 'react'
import createStyleSideEffect from 'react-style-side-effect'
const HtmlStyle = createStyleSideEffect(document.docElement)
const BodyStyle = createStyleSideEffect(document.body)
const RootStyle = createStyleSideEffect(document.getElementById('root'))
export default function MyApp() {
return (
<HtmlStyle className='htmlClass'>
<BodyStyle className='bodyClass'>
<RootStyle className='rootClass'>
...
</RootStyle>
</BodyStyle>
</HtmlStyle>
)
}