-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rule to ensure forwardRef includes a ref
argument.
#3158
Comments
That seems like a useful thing to validate. Would the fix be "force use of a ref", or would it be "make it a functional component instead"? The latter seems to make sense to me - an autofix for that would be pretty aggressive in development though, altho a suggestion could work. I am hesitant to add a whole new rule just for that one thing, but there's not really another place to put it. Thoughts? |
IME this is less often a "I used forwardRef without intending to" vs "I intended to pass a ref through but forgot". I agree an autofix would be aggressive and probably frustrating in development.
yeah its a small thing, I can't really think of a good alternative place though. Maybe it's not so bad as it's own rule though, a number of the existing rules are narrowly scoped. |
alrighty, why not - let's add a
|
Howdy, not sure if this is a question or suggestion for a new rule, but i've not managed to find an existing rule to cover it.
But i'd like to find a rule that flags the following as an error, because the
ref
argument is not present.Whether or not the ref is used is already handled by no-unused-vars.
The text was updated successfully, but these errors were encountered: