-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code
Description
Typescript@2.1.6
Using "@types/react": "^0.14.41", and "@types/react-dom": "^0.14.18" (installed via npm).
When I write
declare module 'react' {
interface HTMLProps<T> {
onTouchTap?: React.EventHandler<React.TouchEvent<T>>;
}
}
in a customTypings/react-tap-touch.d.ts file, it seems to cause tsc to report a lot of errors (error TS2604: JSX element type 'Router' does not have any construct or call signatures and similar). Looks like react namespace is overriden rather than extended.
Using the same snippet in a startup.ts file works fine (i.e., extends react and doesn't override it).
What's the difference between extending a namespace from .d.ts vs .ts file? Shouldn't .d.ts be the right place to do this sort of thing?
The issue is summed up by this comment:
zilverline/react-tap-event-plugin#58 (comment)
Haroenv
Metadata
Metadata
Assignees
Labels
QuestionAn issue which isn't directly actionable in codeAn issue which isn't directly actionable in code