Closed bartgrundeken closed 7 months ago
i have same problems in react native. Because it is not compatible with typescript version. There are many ways to fix it but you can try this. it works for me
your case
"resolutions": { "@types/react": "~18.2.55" },
i have same problems in react native. Because it is not compatible with typescript version. There are many ways to fix it but you can try this. it works for me your case
"resolutions": { "@types/react": "~18.2.55" },
Thanks for the response. I have since moved away from using this library (because in the end it did not fit our use case, not because of this issue) but hopefully others can use this.
What does your TSConfig look like? I'll try the React TS template.
just use "jsx": "react-jsx",
in tsconfig.json
can help.
Sounds related to #3270.
What does your TSConfig look like? I'll try the React TS template.
Sorry for the late reply @CodyJasonBennett
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Default",
"compileOnSave": false,
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"jsx": "react-jsx",
"lib": ["es2017", "dom"],
"module": "esnext",
"moduleResolution": "node",
"outDir": "out-tsc",
"skipDefaultLibCheck": true,
"skipLibCheck": true,
"sourceMap": true,
"strictNullChecks": true,
"target": "es2017"
},
"exclude": ["node_modules", "tmp"]
}
The project is created from a standard vite-react-ts app.
I have created a Vite React app using the
react-ts
template, then included the demo code inmain.tsx
:root.css
only includes some sizing and margin styling for#canvas-container
.The example runs fine but VSCode complains, and after running
tsc
, I get this error:These are my deps:
Putting
{/* @ts-ignore */}
above the Canvas element silences the error (obviously) but that is of course a very poor workaround.