Typescript namespace errors
See original GitHub issueWhen trying to compile to typescript I am getting the following errors:
node_modules/@types/react-select/src/components/Control.d.ts:21:34 - error TS2694: Namespace 'React' has no exported member 'MouseEvent'.
21 onMouseDown: (event: React.MouseEvent<HTMLElement>) => void,
~~~~~~~~~~
node_modules/@types/react-select/src/components/Control.d.ts:25:42 - error TS2694: Namespace 'React' has no exported member 'CSSProperties'.
25 export function css(state: State): React.CSSProperties;
These are the types I have installed:
"@types/react": "^16.9.36",
"@types/react-dom": "^16.9.8",
"@types/react-select": "^3.0.13",
"@types/react-transition-group": "^4.4.0",
This is the command I’m currently using to compile:
tsc src/*.tsx --jsx 'react' --outDir lib/
Note: I am using Preact
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Documentation - Namespaces - TypeScript
This post outlines the various ways to organize your code using namespaces (previously “internal modules”) in TypeScript. As we alluded in our note...
Read more >How do I use namespaces with TypeScript external modules?
I have some code: baseTypes.ts export namespace Living.Things ...
Read more >Fixing the "Cannot Use Namespace as a Type" Error in ...
Are you experiencing the “cannot use namespace as a type” error in TypeScript? This error can occur when you try to import types...
Read more >How To Use Namespaces in TypeScript | DigitalOcean
This tutorial will reference aspects of text editors that support TypeScript and show in-line errors. This is not necessary to use TypeScript ......
Read more >no-namespace - TypeScript ESLint
.exports = { · "rules": { · "@typescript-eslint/no-namespace": "error" · } · }; ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @c2rob, @Methuselah96, and @RyanChristian4427,
Thanks for the help provided here. If this is indeed something that
react-select
doesn’t need to solve, I’ll close this issue for now, however if you think it should be re-opened, please do let me know.It is indeed a Preact issue, the types exported aren’t as complete as could be desired. Contributions are always welcome though.
This isn’t something for
react-select
to fix.