ArnaudBarre / eslint-plugin-react-refresh

Validate that your components can safely be updated with Fast Refresh
MIT License
206 stars 13 forks source link

Support for styled components #32

Closed skovhus closed 11 months ago

skovhus commented 11 months ago

Do we need some special treatment for styled components? At least I'm getting an unexpected error Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components for styled components like AnotherReactContainer in this example:

import styled from "styled-components";

export const SomeReactComponent = () => (<div>Test</div>);

export const AnotherReactContainer = styled.div`
  padding-bottom: 6px;
`;
ArnaudBarre commented 11 months ago

Fixed in 0.4.5!