question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React-compat type definitions for `preact/compat`?

See original GitHub issue

I 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:open
  • Created 4 years ago
  • Reactions:6
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ForsakenHarmonycommented, Feb 13, 2020

Can you alias them directly when you have compatible typings?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found