Improve react typescript compatibility - #2329
Conversation
|
Fixed #1930 |
|
For clarity, I am trying to get an existing react project working with preact. I encountered a number of typescript incompatibilities as described in #1930 and attempted to fix them with the proposed changes. I added the following in my tsconfig.json: And in package.json applied a browserify global transform using aliasify to alias react and react-dom to preact/compat. |
|
Incorporated #2150 (comment) |
|
I know it's been a while, there are some more types missing in #2414 if you want to add those |
|
Any chance this could be merged? 👼 |
| import { JSXInternal } from '../../src/jsx'; | ||
|
|
||
| export = JSXInternal; | ||
| export as namespace JSX; No newline at end of file |
There was a problem hiding this comment.
I think this broke typescript before
There was a problem hiding this comment.
In what way? I skimmed through the referenced issue but did not understand how this breaks typescript. This file declares the JSX namespace, without which, typescript does not process jsx. This is also the same way react itself exports the JSX namespace
|
When using I wasn't using this branch though, but I guess you need to add |
|
@bvella could you update this branch with the base branch so it can be re-approved and then released? |
|
Any update on this? Is there a complete workaround with all the changes needed to perform to a Preact project to be able to use typed React libraries in it until it merged? |
|
I would like to contribute to this effort.. I'm not sure how to do it besides creating a separate PR. Is that ok? |
No description provided.