-
Notifications
You must be signed in to change notification settings - Fork 2k
Can't use tfjs-vis in a React app due to Preact typings collision #1415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Updating issue after convo with David. Workaround is to delete preact.d.ts in node_modules/preact/dist and node_modules/preact/src I suspect the preact 8.* typings are just incompatible with react 16s latest typings. But can dig deeper when I get a chance. Either way preact typings should not be relevant for consumers of tfjs-vis. |
Yep, thanks. An effective workaround is to add this to package.json:
That way the irrelevant preact types are automatically deleted after every |
Thanks David! I might keep it open for a bit just to remind me to investigate typings drift between the projects (though I do think your solution is the right one, react users would always want to use react types). So I might close it soon (maybe i'll remove the bug tag since it has a solution). |
- Add Grommet for UI components - Fix to work with tfjs-vis (preact JSX type namespace collition) - tensorflow/tfjs#1415 💕💕💕
- Add Grommet for UI components - Fix to work with tfjs-vis (preact JSX type namespace collition) - tensorflow/tfjs#1415 💕💕💕
Depending on tfjs-vis from our React app causes trouble. We use @types/react, but tfjs-vis uses preact, which provides colliding global JSX definitions.
The problem started with tfjs-vis 0.5.1 (and persists in 1.0.x). I don't understand why things worked with tfjs-vis 0.5.0; still trying to pin down any relevant difference.
Some background on the issue:
preactjs/preact#1036
microsoft/TypeScript#18588 (maybe?)
The text was updated successfully, but these errors were encountered: