Skip to content

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

@alloy

Description

@alloy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededtype differenceAll about differences between Flow and TS typings (e.g. in React)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions