Support React's new JSX transform
See original GitHub issueFeature request
React 17 came with a new JSX transform feature which allow user to omit import React from 'react'
from components. This feature has also been added back into v16
, v15
and v0.14
then.
I moved from ts-loader
to esbuild-loader
for its performance. But when I want to use the new JSX transform I notice that esbuild has not supported yet while TypeScript 4.1 already supports it.
Why?
evanw suggested a plugin approach, and I believe this loader is a good place for doing it.
Alternatives
No response
Additional context
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:8
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Introducing the New JSX Transform – React Blog
Although React 17 doesn't contain new features, it will provide support for a new version of the JSX transform. In this post, we...
Read more >React 17 introduces new JSX transform - Saeloun Blog
Now, with React adding support for a new version of JSX transform, React and, React-like libraries can optimize the creation of JSX elements ......
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
New JSX Transform in React blog presents what and why new JSX Transform use, JSX advantages, disadvantages and JSX hook examples.
Read more >Enable the new JSX Transform in React Native 0.64
Enable the new JSX Transform in React Native 0.64 · import React. at the top of every file. · ReferenceError: Property 'React' doesn't...
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 Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Nevermind, I found it. For anyone that might get here from google search, this is the config:
Using this new option renders this unnecessary:
@privatenumber Maybe this section of the docs should be updated in order to reflect this.
Evan means esbuild plugins, not just any plugin.
esbuild-loader uses esbuild’s transform API, which doesn’t support esbuild plugins.
If you want to omit the React import, you can use Webpack’s Provide Plugin.
Closing since this feature request belongs in esbuild rather than esbuild-loader.