Without Import React #8120
Closed
bigbigDreamer
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Whether the initialized document project can be compiled with the new babel, automatically import React, no need to import it anywhere, and transform the original Typescipt configuration at the same time.
React Docs-New-Jsx-Transform
// babel.config.js module.exports = { presets: [ require.resolve('@docusaurus/core/lib/babel/preset'), + [ + '@babel/preset-react', + { + runtime: 'automatic', + }, + ], ], };Typescript 4.1-Jsx-Factories
{ // This file is not used in compilation. It is here just for a nice editor experience. "extends": "@tsconfig/docusaurus/tsconfig.json", "compilerOptions": { "baseUrl": ".", + "jsx": "react-jsx" } }Beta Was this translation helpful? Give feedback.
All reactions