webstorm-styled-components
webstorm-styled-components copied to clipboard
[Feature Request] Refactor to styled component
When developing new components I usually start of writing css inline using the normal style object, like so:
<div style={{backgroundColor: 'red', border: '1px solid blue' }} />
It would be nice if this plugin could hook into the refactor context menu and add an "extract Styled Component" option. Just like we already have a "Extract Component..." option:
Then from the aboven example create something like:
const MyComponent = styled.div`
background-color: red;
border: 1px solid blue;
`
👍 This is one thing I miss a lot from a similar VS Code extension.
👍 as well. Would love to see this enter the Webstorm workflow since I commonly find myself wanting to auto generate a snippet from the development. Anyone able to tackle this?