Support new React 17 JSX Transforms (runtime: automatic)
See original GitHub issueReact 17 has a new JSX Transform that Next.js 10 has default support for. Other projects, like Emotion 11 also have support.
I don’t believe mdx-js does yet, when I try to build with a .babelrc
like:
{
"presets": [
[
"next/babel",
{
"preset-react": {
"runtime": "automatic",
"importSource": "@emotion/react"
}
}
]
],
"plugins": ["@emotion/babel-plugin"]
}
@mdx/loader
fails with importSource cannot be set when runtime is classic
when building. Related StackOverflow issue.
It looks like this may be on the way in v2? I didn’t see an existing issue to track, so opening this.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:19
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Introducing the New JSX Transform – React Blog
Instead of transforming JSX to React.createElement , the new JSX transform automatically imports special functions from those new entry points ...
Read more >React 17 introduces new JSX transform - Saeloun Blog
React 17 introduces jsx-runtime and jsx-dev-runtime that enables the user to write JSX without importing React.
Read more >React 17: New JSX Transform - JavaScript in Plain English
React 17, 16.4, 15.7, and 0.14.10 released a new feature that no longer requires importing React to transform JSX. This is a comprehensive...
Read more >How to Use New JSX Transform IN REACT - Aspire Blogs
in React 17, The new JSX transforms imports a special function from these entry points automatically and calls them.
Read more >babel/plugin-transform-react-jsx
Automatic runtime is a feature added in v7.9.0 . With this runtime enabled, the functions that JSX compiles to will be imported automatically....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue, adding support for the automatic JSX runtime, is now supported. By default. In the latest RC. Please see https://v2.mdxjs.com for more info, and do let us know of anything you‘re running into or other suggestions!
This may become configurable as part of https://github.com/mdx-js/mdx/pull/1413