1.0.1 • Published 6 years ago

style-injector-inline v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
6 years ago

#How to use it

Installation

> npm i --save style-injector-inline

Usage

import toInjectable from 'style-injector-inline'

class App extends React.Component{
    render(){
        return <div>hellow world!</div>
    }    
}

export default toInjectable(App)
import App from 'example/App.js'

ReactDOM.render(<App inject={[{className:"*",style:{fontSize:20}}]}/>, document.getElementById('root'));

//result
/******************************************************
 *
 *  <div>hellow world!
 *      <style>.app_[hash:5] *{font-size:20px}</style>
 *  </div>
 *
 ******************************************************/