Skip to content

Use a closure to bind argument to callback in ReactErrorUtils - #8363

Merged
gaearon merged 2 commits into
react:masterfrom
aweary:dev-event-handler-args
Nov 28, 2016
Merged

gaearon merged 2 commits into
react:masterfrom
aweary:dev-event-handler-args

Conversation

@aweary

@aweary aweary commented Nov 20, 2016

Copy link
Copy Markdown
Contributor

See discussion starting here.

This prevents the fake event used here from being passed to the callback. This was causing issues where event handlers received an extra argument in dev only.

@gaearon I verified this fix resolves the issue by building and testing in the basic click counter example. I'm not sure where a unit test for this would go.

This way the fake event isn't being implicitly passed into the event handler
@gaearon

gaearon commented Nov 20, 2016

Copy link
Copy Markdown
Contributor

Feel free to add a test for ReactErrorUtils if one doesn't exist already. You could also look at change history to see if there were any related tests introduced with this file in the first place.

Can you confirm single argument matches production behavior?

@aweary

aweary commented Nov 28, 2016

Copy link
Copy Markdown
Contributor Author

@gaearon I added test for ReactErrorUtils 👍

@gaearon

gaearon commented Nov 28, 2016

Copy link
Copy Markdown
Contributor

Lint is failing.

@gaearon

gaearon commented Nov 28, 2016

Copy link
Copy Markdown
Contributor

Tagging as minor since somebody might have accidentally relied on that.

@gaearon

gaearon commented Nov 28, 2016

Copy link
Copy Markdown
Contributor

Linter fails.

Add fiber test report

Linting fixes
@aweary
aweary force-pushed the dev-event-handler-args branch from 996e59d to f293884 Compare November 28, 2016 16:31
@aweary

aweary commented Nov 28, 2016

Copy link
Copy Markdown
Contributor Author

@gaearon fixed 👍

@gaearon
gaearon merged commit 6947db1 into react:master Nov 28, 2016
@gaearon

gaearon commented Nov 28, 2016

Copy link
Copy Markdown
Contributor

LGTM

@gaearon gaearon modified the milestones: 15-hipri, 15-lopri Jan 6, 2017
@aweary
aweary deleted the dev-event-handler-args branch January 26, 2017 16:18
acusti pushed a commit to brandcast/react that referenced this pull request Mar 15, 2017
…8363)

* Use a closure to bind gaurded callback

This way the fake event isn't being implicitly passed into the event handler

* Add tests for ReactErrorUtils

Add fiber test report

Linting fixes
@aweary aweary mentioned this pull request Jul 11, 2017
12 tasks
mrizwanashiq pushed a commit to mrizwanashiq/react that referenced this pull request Jun 25, 2026
…8363)

* Use a closure to bind gaurded callback

This way the fake event isn't being implicitly passed into the event handler

* Add tests for ReactErrorUtils

Add fiber test report

Linting fixes
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