Skip to content

Conversation

@AntonChesnokov
Copy link

Summary

Fix react-hooks/set-state-in-effect false negatives when Hooks are called via a namespace import (e.g. import * as React from 'react' and React.useEffect(...)). The validation now checks the MethodCall property (the actual hook function) instead of the receiver object.

Issue: Bug: #35377

How did you test this change?

Added a regression fixture;
Ran tests and verified it reports EffectSetState and matches the expected output.

Screenshot 2025-12-27 at 14 13 38

…facebook#35377)

ValidateNoSetStateInEffects treats MethodCall.property as the hook callee (so React.useEffect is detected).\n\nAdds a regression fixture for import * as React with React.useState/React.useEffect.
@meta-cla meta-cla bot added the CLA Signed label Dec 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant