[Flare] Move createEvent back to React object#15943
Merged
trueadm merged 3 commits intofacebook:masterfrom Jun 21, 2019
Merged
Conversation
|
React: size: 🔺+0.3%, gzip: 🔺+0.3% ReactDOM: size: 0.0%, gzip: -0.1% Details of bundled changes.Comparing: 175111d...d2dea53 react
react-events
react-dom
Generated by 🚫 dangerJS |
Contributor
|
LGTM. Don't think the types need changing back from ReactDOM to React as the ReactDOM types are only used in ReactDOM files. And it sounds like it's still something to figure out. |
necolas
approved these changes
Jun 21, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Internally, we ran into issues with exporting
createEventonReactDOM. Moving this back toReactfixes the issue. This is because theReactDOMmodule has side-effects that occur upon initialization of the module, which breaks in cases such as server-side rendering.Lately, given the
useEventhook, it might make more sense for us to keepcreateEventon theReactobject. In the RN integration PR, I found better ways to ensure Flow type safety whilst doing so, so it might be worth while looking at how we can incorporate a polymorphiccreateEventon theReactobject, where theresponderfield might relate to different responders depending on the platform.The event responders exported should always be the same shape between platforms anyway, the only thing that differs is the props they receive – so this should be safe to do.
@sebmarkbage I'd really like it if you could chime in on this one too :)