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

Difference between RN's and DT's SyntheticEvent type #17

Open
alloy opened this issue Jan 21, 2021 · 0 comments
Open

Difference between RN's and DT's SyntheticEvent type #17

alloy opened this issue Jan 21, 2021 · 0 comments
Labels
help wanted Extra attention is needed type difference All about differences between Flow and TS typings (e.g. in React)

Comments

@alloy
Copy link
Member

alloy commented Jan 21, 2021

In RN’s upstream type, most of the properties are Maybe types. Whereas in DT’s React type they are all required properties. This means that a value with RN’s type cannot be assigned to a target that expects DT’s type.

I only came across 1 such case in Artsy’s codebase, which I solved locally with a utility type that removes all the Maybe variants. It is unclear if this issue structurally applies to RN projects or is more of an issue with e.g. Formik relying on HTML event types.

@alloy alloy added help wanted Extra attention is needed type difference All about differences between Flow and TS typings (e.g. in React) labels Jan 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed type difference All about differences between Flow and TS typings (e.g. in React)
Projects
None yet
Development

No branches or pull requests

1 participant