Sourced from eslint-plugin-react-refresh's releases.
v0.5.7
Add
allowCompoundComponentsoption (#117)Default:
false(trueinviteconfig)Don't warn when components are exported as an object gathering them. Every member of the object must be a component, and a member holding an anonymous function requires a component name as key.
This should be enabled if the fast refresh implementation correctly handles this case. Vite supports it since
@vitejs/plugin-react4.7.0,@vitejs/plugin-react-swc3.11.0.{ "react-refresh/only-export-components": [ "error", { "allowCompoundComponents": true } ] }Enabling this option allows code such as the following:
const Root = () => <></>; const Label = () => <></>; export const Tag = { Root, Label };
Sourced from eslint-plugin-react-refresh's changelog.
0.5.7
Add
allowCompoundComponentsoption (#117)Default:
false(trueinviteconfig)Don't warn when components are exported as an object gathering them. Every member of the object must be a component, and a member holding an anonymous function requires a component name as key.
This should be enabled if the fast refresh implementation correctly handles this case. Vite supports it since
@vitejs/plugin-react4.7.0,@vitejs/plugin-react-swc3.11.0.{ "react-refresh/only-export-components": [ "error", { "allowCompoundComponents": true } ] }Enabling this option allows code such as the following:
const Root = () => <></>; const Label = () => <></>; export const Tag = { Root, Label };
fd40d83
Add allowCompoundComponents option [publish] (#117)