Open
Description
openedon Oct 23, 2023
Write this code:
function lazyEdit( load ) {
const Load = lazy( load );
return function LoadEdit( props ) {
return (
<Suspense fallback={ null }>
<Load { ...props } />
</Suspense>
);
};
}
It defines a Load
local variable and uses it in the returned function, as a JSX component type.
But the @wordpress/no-unused-vars-before-return
incorrectly flags it as unused:
Apparently the rule doesn't find the usage in a JSX markup that is nested inside a local function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
/packages/eslint-plugin/packages/eslint-pluginAn existing feature does not function as intendedAn existing feature does not function as intended