React-compat type definitions for `preact/compat`?
See original GitHub issueI don’t think this would be an easy task, but some libraries (i.e. linaria/react)'s type definitions are based on the type definitions of @types/react
, which isn’t compatible with Preact’s type definitions. I tried aliasing TypeScript module resolution via tsconfig but it didn’t give me the result I expected.
Could we have a compatible type definitions on preact/compat? Any solutions for solving this type issue is also welcome.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:6
- Comments:7 (3 by maintainers)
Top Results From Across the Web
TypeScript | Preact: Fast 3kb React alternative with the same ...
Preact ships TypeScript type definitions, which are used by the library itself! ... TypeScript configuration; TypeScript preact/compat configuration ...
Read more >@preact/compat - npm
Start using @preact/compat in your project by running `npm i ... There are 7 other projects in the npm registry using @preact/compat.
Read more >Fixing JSX types between Preact and React Libraries
To summarize, the main issue seems to be that, although Preact is “shipping” a lot of types needed for React compatibility, they aren't ......
Read more >Aliasing react as preact throws Cannot find module: 'react/jsx ...
It looks like you were referring to a dated documentation page. Here is the latest one. Your should use preact/compat instead:
Read more >@astrojs/preact 🚀 Astro Documentation
With the compat option enabled, the Preact integration will render React components as well as Preact components in your project and also allow...
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
Can you alias them directly when you have compatible typings?
See https://github.com/preactjs/preact/issues/2150#issuecomment-558622551
It might help you