TS errors when importing
mnpqraven opened this issue · 5 comments
Describe the bug
In the new version of 'react-inlinesvg' the return type of the component contains undefined
and will lead to typescript errors. I have my repo setup to cancel builds when there are typescript errors and therefore can't build with the current version of 'react-inlinesvg'. For now I've downgraded to 3.0.3
and it works without errors
Link to repl or repo (highly encouraged)
The errors can be seen at the example codesandbox
Hey @mnpqraven
You probably need to update your types.
Or your typescript version.
Codesandbox VS code editor uses typescript 4.x, but the bundler uses 5.x. That's why you see the errors in the editor, but it renders without issues.
I've upgraded @types/react
to the required version (^18.2.20
even). There's no longer errors in the editors but those errors will still appear during build and cancel build for me.
For context this is typescript 5 and on the latest version of nextjs
I've managed to solve the errors during build by bumping typescript
from 5.0.1
to 5.1.6
. I think just ts 5 is not enough and you might still need a newer ts release.
@mnpqraven The library does not have TypeScript as a dependency. It uses the host app version.