-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Import JSX to avoid tsc namespace error #22
Conversation
Huh, this is odd and shouldn't be necessary. What does your TypeScript config look like? Why are you type-checking |
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"moduleDetection": "force",
"resolveJsonModule": true,
"esModuleInterop": true,
"isolatedModules": true,
"allowJs": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"strict": true,
"incremental": true,
"noUncheckedIndexedAccess": true,
"target": "ES2022",
"module": "Node16",
"moduleResolution": "Node16",
"checkJs": true,
"jsx": "preserve"
},
"include": [
"remdx-env.d.ts",
"**/*.ts",
"**/*.tsx",
"**/*.js",
"**/*.jsx",
"**/*.cjs",
"**/*.mjs"
],
"exclude": ["node_modules", "slideDecks/*/dist"]
}
/// <reference types="@nkzw/remdx/client.d.ts" /> |
I tried this with a new ReMDX project and with your config, and this issue does not repro for me. |
Hmm ok interesting, wonder if it has to do with us using the new types:
"devDependencies": {
"@types/react": "npm:types-react@19.0.0-rc.1",
"@types/react-dom": "npm:types-react-dom@19.0.0", Also, elsewhere in the monorepo I have this (I'm guessing it shouldn't affect this package, but maybe something is happening there):
"compilerOptions": {
"jsxImportSource": "@emotion/react", |
Ah yeah, maybe it's a React 19 thing: |
Ugh, that changes makes sense but is kinda annoying. |
Published as 0.14.1. |
Thanks! |
To avoid type error with not being able to find
JSX
namespaceMy original approach used the
React
global:But there's already an import from
'react'
, so it seems simpler to add to that.