[@types/react] Export NativeXEvent
#69406
Unanswered
oliveryasuna
asked this question in
Issues with a @types package
Replies: 1 comment
-
Thanks for the discussion about "react", some useful links for everyone: Pinging the DT module owners: @johnnyreilly, @bbenezech, @pzavolinsky, @ericanderson, @DovydasNavickas, @theruther4d, @guilhermehubner, @ferdaber, @jrakotoharisoa, @pascaloliv, @Hotell, @franklixuefei, @Jessidhia, @saranshkataria, @lukyth, @eps1lon, @zieka, @dancerphil, @dimitropoulos, @disjukr, @vhfmag, @hellatan, @priyanshurav, @Semigradsky, @mattpocock. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In a TypeScript project with React, when you specify types like
FocusEvent
, TypeScript may resolve this to React's own event type (React.FocusEvent
), rather than the native DOM event typeFocusEvent
. This can lead to confusion and unintentional type-errors.I see no way around this, besides re-defining the native DOM event types with a new name. This will work as a drop-in replacement due to TypeScript structural typing system.
I propose the following types be exported: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/index.d.ts#L10-L21.
Beta Was this translation helpful? Give feedback.
All reactions