1.0.1 • Published 3 years ago

babel-plugin-react-style-string v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago
Adds support style as strings instead of object declaration in react components

For what

To quickly preview changes without creating objects and copy the style as it is from browsers devtool

function Component() {
    return <div style="border-color:red;height:100px"/>
}

instead of this

function Component() {
    return <div style={{ borderColor: 'red', height: '100px'}} />
}

Install

yarn add babel-plugin-react-style-string
npm install babel-plugin-react-style-string

babel.config.js or .babelrc

module.exports = { plugins: ['babel-plugin-react-style-string'] };

NextJS integration