File tree 2 files changed +6
-6
lines changed 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
6
6
7
7
## Unreleased
8
8
9
+ ### Changed
10
+ * [ Refactor] [ ` destructuring-assignment ` ] : use ` getParentStatelessComponent ` ([ #3835 ] [ ] @golopot )
11
+
12
+ [ #3835 ] : https://github.com/jsx-eslint/eslint-plugin-react/pull/3835
13
+
9
14
## [ 7.37.1] - 2024.10.01
10
15
11
16
### Fixed
Original file line number Diff line number Diff line change @@ -196,12 +196,7 @@ module.exports = {
196
196
'FunctionExpression:exit' : handleStatelessComponentExit ,
197
197
198
198
MemberExpression ( node ) {
199
- let scope = getScope ( context , node ) ;
200
- let SFCComponent = components . get ( scope . block ) ;
201
- while ( ! SFCComponent && scope . upper && scope . upper !== scope ) {
202
- SFCComponent = components . get ( scope . upper . block ) ;
203
- scope = scope . upper ;
204
- }
199
+ const SFCComponent = utils . getParentStatelessComponent ( node ) ;
205
200
if ( SFCComponent ) {
206
201
handleSFCUsage ( node ) ;
207
202
}
You can’t perform that action at this time.
0 commit comments