Skip to content

Adds support style as strings instead of object declaration in react components

Notifications You must be signed in to change notification settings

bbutkov/babel-plugin-react-string-style

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Adds support style as strings instead of object declaration in react components

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published