You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 1, 2022. It is now read-only.
Had to --force the package to install under [email protected] and also had issues with Typescript types that was resolved with npm i --save-dev @types/react-canvas-draw --force
The text was updated successfully, but these errors were encountered:
Actually still getting errors with typescript: Could not find a declaration file for module 'react-canvas-draw' - the recommended resolution (above) didn't work after all.
The solution for typescript is to add a file called type.d.ts and put this line in it: declare module 'react-canvas-draw'; - that will be enough for the compiler to accept the import of the module.
leeprobert
changed the title
Support for React 18
Support for React 18 & typescript
May 12, 2022
If you need to start doing anything useful with this component in Typescript you'll have to start declaring all the types. My declaration file is currently:
import CanvasDraw from "react-canvas-draw";
// this is required for Typescript to recognise the CanvasDraw package
declare module 'react-canvas-draw'{
canvasDraw: CanvasDraw | null;
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Had to
--force
the package to install under[email protected]
and also had issues with Typescript types that was resolved withnpm i --save-dev @types/react-canvas-draw --force
The text was updated successfully, but these errors were encountered: