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 }}
Repository navigation
【Question】'React' refers to a UMD global, but the current file is a module. Consider adding an import instead. #280
I'm getting the same error with TypeScript. The migration guide for the new JSX transforms in React v17 doesn't mention anything about TypeScript and this seems to be a TypeScript error.
My setup:
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-scripts": "4.0.0",
changed the title [-]'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.[/-][+]【Question】'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.[/+]on Mar 6, 2021
Activity
cseas commentedon Nov 21, 2020
I'm getting the same error with TypeScript. The migration guide for the new JSX transforms in React v17 doesn't mention anything about TypeScript and this seems to be a TypeScript error.
My setup:
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react-scripts": "4.0.0",
henryqdineen commentedon Feb 25, 2021
We ran into this also. You can fix it by setting the
jsxcompiler option: https://devblogs.microsoft.com/typescript/announcing-typescript-4-1/#react-17-jsx-factoriesJairwin-L commentedon Mar 6, 2021
ok
[-]'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.[/-][+]【Question】'React' refers to a UMD global, but the current file is a module. Consider adding an import instead.[/+]chandrarishabh commentedon Jun 15, 2021
how to use JSX transforms with TypeScript3.9? Any leads?
cseas commentedon Jun 16, 2021
If you're talking about the new jsx transform that comes with react v17, that's only supported in TypeScript 4.1+
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-1.html#react-17-jsx-factories