A pattern we use commonly in our codebase (pre-dates me, and we're too far along the road now to change) is to prefix some components with an underscore e.g. when forwarding refs, or to signal a component shouldn't be exported etc.
Components with this naming convention do not get detected as parent components, and thus the unstable nested components are not flagged
function _Parent() {
function NotFlagged() {
return <b>oh no</b>
}
return <NotFlagged />
}
Given there have been other issues raised relating, and carve outs added for, this naming convention:
I think this constitutes a bug/oversight in this rule. Happy to make a PR, if there is agreement
A pattern we use commonly in our codebase (pre-dates me, and we're too far along the road now to change) is to prefix some components with an underscore e.g. when forwarding refs, or to signal a component shouldn't be exported etc.
Components with this naming convention do not get detected as parent components, and thus the unstable nested components are not flagged
Given there have been other issues raised relating, and carve outs added for, this naming convention:
react/prop-typesnot working when prefixing function with underscore_#3560I think this constitutes a bug/oversight in this rule. Happy to make a PR, if there is agreement