Skip to content

Conversation

avaice
Copy link

@avaice avaice commented Sep 22, 2025

Fixes #3524

This PR fixes a bug where react/no-unused-prop-types was not properly detecting unused props in components wrapped with nested wrapper functions like React.memo(React.forwardRef()).

  • Enhanced component detection logic to properly traverse nested wrapper functions when looking for propType definitions
  • Added logic to find the actual component node that declares propTypes when dealing with nested wrapper patterns
  • The fix ensures that prop usage is correctly detected by finding the component that actually defines the propTypes, regardless of how many wrapper functions are nested

@avaice avaice marked this pull request as ready for review September 22, 2025 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: False positive on react/no-unused-prop-types with memo + forwardRef
1 participant