Skip to content
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

Support React v17 #4

Merged
merged 1 commit into from
Nov 1, 2020
Merged

Support React v17 #4

merged 1 commit into from
Nov 1, 2020

Conversation

taehwanno
Copy link
Owner

@taehwanno taehwanno commented Oct 31, 2020

In React v17, the synthetic event object structure is changed. As you can see below link, the Interface of specific event is not referenced by constructor in the event's proto (Object.getPrototypeOf return value).

See: https://github.com/facebook/react/blob/v17.0.0/packages/react-dom/src/events/SyntheticEvent.js#L28

But when I look at BaseSyntheticEvent in ReactSyntheticEventType, some properties are still being used. is-react-synthetic-event's internal implementation was modified in consideration of backward compatibility.

See: https://github.com/facebook/react/blob/v17.0.0/packages/react-dom/src/events/ReactSyntheticEventType.js#L25-L36

checklist

  • Implementation re-consideration (Looking at the discussion, SyntheticEvent can disappear and only browser native events are likely to be used in React. It is necessary to consider whether the current implementation is best. but when considering the purpose of this package, I think the current modified implementation is enough.)

@taehwanno taehwanno self-assigned this Oct 31, 2020
In v17, the synthetic event object structure is changed. As you can see
below link, the Interface of specific event is not referenced by
constructor in the event's proto (Object.getPrototypeOf return value).

See: https://github.com/facebook/react/blob/v17.0.0/packages/react-dom/src/events/SyntheticEvent.js#L28

But when I look at BaseSyntheticEvent in ReactSyntheticEventType, some
properties are still being used. The internal implementation was
modified in consideration of backward compatibility.

See: https://github.com/facebook/react/blob/v17.0.0/packages/react-dom/src/events/ReactSyntheticEventType.js#L25-L36
@taehwanno taehwanno merged commit 2bb30cf into main Nov 1, 2020
@taehwanno taehwanno deleted the update/react-v17 branch November 1, 2020 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant