-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Call getComponent with nextState instead of location #3298
Conversation
From taion/rrtr#16 |
18da3c9
to
41cd4c2
Compare
|
||
if (__DEV__) { | ||
if (typeof Proxy === 'function') { | ||
nextStateWithLocation = new Proxy(nextStateWithLocation, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do this without Proxy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use something like deprecateObjectProperties
, but it'd be a bit more code. This is what React does upstream to prevent people from messing with synthetic events: https://github.com/facebook/react/blob/v15.0.1/src/renderers/dom/client/syntheticEvents/SyntheticEvent.js#L188.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, no, I guess they do something different for properties: https://github.com/facebook/react/blob/v15.0.1/src/renderers/dom/client/syntheticEvents/SyntheticEvent.js#L167. I'll update this.
41cd4c2
to
3076dca
Compare
I've updated the PR to use |
I'd like to cut v2.2.0 after we merge this, if possible. (I'll update the changelog) |
👍 |
Fixes #3262