@@ -271,10 +271,10 @@ fn detect_variable_component(
271271 return Some ( DetectedComponent { name, span : decl. span , is_stateless : true } ) ;
272272 }
273273
274- // Sequence expression: const Foo = (0, () => <div/>)
274+ // Sequence expression: const Foo = (0, () => <div/>) or const Foo = (0, () => null)
275275 if let Expression :: SequenceExpression ( seq) = init
276276 && let Some ( last) = seq. expressions . last ( )
277- && expression_contains_jsx ( last)
277+ && ( expression_contains_jsx ( last) || is_function_returning_null ( last ) )
278278 {
279279 return Some ( DetectedComponent { name, span : decl. span , is_stateless : true } ) ;
280280 }
@@ -311,12 +311,14 @@ fn get_hoc_callee_name(call: &CallExpression, ctx: &LintContext) -> Option<Strin
311311 }
312312
313313 // Check for aliased imports: const myMemo = React.memo
314+ // Note: This does not handle destructured aliased imports like `const {memo: myMemo} = React`
314315 let Expression :: Identifier ( ident) = & call. callee else {
315316 return None ;
316317 } ;
317318
318319 let scoping = ctx. scoping ( ) ;
319- let symbol_id = scoping. get_binding ( scoping. root_scope_id ( ) , & ident. name ) ?;
320+ let reference = scoping. get_reference ( ident. reference_id ( ) ) ;
321+ let symbol_id = reference. symbol_id ( ) ?;
320322 let decl_node = ctx. nodes ( ) . get_node ( scoping. symbol_declaration ( symbol_id) ) ;
321323 let AstKind :: VariableDeclarator ( var_decl) = decl_node. kind ( ) else {
322324 return None ;
0 commit comments