-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Autofocus should warn like for attribute. #3248
Comments
Just submitted a pull request for this. |
Just ran into this issue re. @jonhester Are you still fleshing out your PR? #3269 |
Got tripped up by this today. #3269 is closed, so I'll give this a shot. |
Had to revert the fix so reopening. |
Moving the discussion here instead of the closed PR
@zpao are there any other properties like this that we're unable to validate right now because of how we inject values used in validateProperty based on a whitelist? If not @hkal I think providing autoFocus as a default in getPossibleStandardName is a decent solution for now. IMO ideally validating a property would be independent of any whitelist, but if there aren't many other cases like this it's probably not worth addressing now since the whitelist is on its way out. |
I think just inserting a default (with a comment explaining why) is probably the best way forward. I'm pretty sure this is the only one. FWIW we do something similar for events and have a 1-off special case there too (though needs to be done differently) - https://github.com/facebook/react/blob/master/src/renderers/shared/stack/event/EventPluginRegistry.js#L155-L164 |
@hkal do you want to get another PR open adding the default + explanation? |
If user writes for instead of htmlFor, warning is shown. I suppose autofocus instead of autoFocus should warn too.
The text was updated successfully, but these errors were encountered: