Closed mark-todd closed 2 years ago
I've been doing a bit more digging - I found if in the tsconfig I use:
"jsx": "react-jsx"
instead of:
"jsx": "react"
Some of the errors disappear. Is it possible that this is occurring because I've defined a tsconfig at the app level that differs from yours in some way?
Here is my original tsconfig:
{
"compilerOptions": {
"esModuleInterop": true,
"jsx": "react",
"module": "esnext",
"moduleResolution": "node",
"lib": ["es5", "es6", "DOM.Iterable", "dom", "esnext"],
"strict": true,
"sourceMap": true,
"target": "esnext"
},
"include": ["./src/js", "index.tsx"],
"exclude": ["node_modules"]
}
Hi! First, you are correct about the React error, you can fix that either by adding
import React from "react";
// or this depending on your tsconfig.json
// import * as React from "react";
or by setting "jsx": "react-jsx"
in tsconfig.json
. For more explanation see JSX Transform - React blog, React JSX Factories - TypeScript blog.
I will fix the other errors!
also, these are just TypeScript errors, the demo should still work when run
also, these are just TypeScript errors, the demo should still work when run
Ok thanks - I think our setup might be such that if there are any typescript errors the app won't work
Just published desmos-react@1.1.1
, see if it works now
Perfect - all fixed!
Hi there,
First of all I'm very pleased this module exists - I was looking for something that could do this. Unfortunately, I get multiple errors when I try to run your demo (I've added the script section to my template). My type checker also raises there when I inspect the index.tsx file. A couple of errors I solved by just adding
import React from "react"
- is it just that the module is out of date, or am I doing something wrong?All the best, Mark