diff --git a/rules/S6767/javascript/rule.adoc b/rules/S6767/javascript/rule.adoc index e17f1e46573..507f72b2da3 100644 --- a/rules/S6767/javascript/rule.adoc +++ b/rules/S6767/javascript/rule.adoc @@ -4,6 +4,11 @@ Leaving unused props in a React component can make the code harder to understand To avoid these issues, you should remove any unused props from React components. This helps keep the codebase clean, improves performance, and enhances code readability. +=== Known Issues/Limitations + +False Positives SFC +Stateless Function Components (SFCs) accept props as an argument and return a JSX expression. Even if the function gets called from a component, the props that are only used inside the component are not be considered used by a component. See references for more details. + == How to fix it in PropTypes === Code examples @@ -92,3 +97,4 @@ class Hello extends React.Component { * React Documentation - https://react.dev/learn/passing-props-to-a-component[Passing Props to a Component] * React Documentation - https://react.dev/reference/react/Component#static-proptypes[static propTypes] * React Documentation - https://react.dev/learn/typescript#typescript-with-react-components[TypeScript with React Components] +* ESLint React Plugin Known Limitations - https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unused-prop-types.md#known-issueslimitations