Skip to content

Add warnings for onFocusIn and onFocusOut props - #6296

Merged
jimfb merged 1 commit into
react:masterfrom
jontewks:add-warnings
Mar 24, 2016
Merged

jimfb merged 1 commit into
react:masterfrom
jontewks:add-warnings

Conversation

@jontewks

Copy link
Copy Markdown
Contributor

Resolves #6275

);
warning(
props.onFocusIn == null && props.onFocusOut == null,
'Props onFocusIn and onFocusOut are no longer supported. Use onFocus and ' +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: they were never supported in the first place.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gaearon, updated!

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@jontewks updated the pull request.

1 similar comment
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@jontewks updated the pull request.

props.onFocusIn == null &&
props.onFocusOut == null,
'Props onFocusIn and onFocusOut are not supported. Use onFocus and ' +
'onBlur events instead because they are normalized across browsers.'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Users can use onFocus in leu of onFocusIn because the React variant bubbles. We actually deviate from the standard here, so it's more than just "normalization across browsers".

Perhaps:

React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification, I've updated the error message.

@jimfb

jimfb commented Mar 21, 2016

Copy link
Copy Markdown
Contributor

Seems fine to me, minor nit for the error message and then I think we can take this.

@jontewks

Copy link
Copy Markdown
Contributor Author

@jimfb let me know if anything else should be done for this one, thanks!

@jimfb
jimfb merged commit 414f057 into react:master Mar 24, 2016
@jimfb

jimfb commented Mar 24, 2016

Copy link
Copy Markdown
Contributor

Looks good, thanks @jontewks!

mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
Add warnings for onFocusIn and onFocusOut props
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.

4 participants