Does it support the automatic mode of react 17?
See original GitHub issue💬 Questions and Help
In react 17, new transforms have been added.
In react 17, the import React from "react"
declaration is no longer required. So in my project, I removed the import React from “react” declaration from the svgr template. Then I got the error React is not defined
.
export const template: any = (
{ template }: any,
_: any,
{ componentName, props, jsx }: any,
): any => template.ast`
import React from 'react'; // i want to remove this declaration
import { Icon } from '. /ui/Icon';
const ${componentName} = (${props}) => ${jsx}
${componentName}.defaultProps = Icon.defaultProps;
export default Icon.withComponent(${componentName});
`;
Is it possible that svgr does not support react 17?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
React v17.0 Release Candidate: No New Features
This means that the older versions of React Native for Web won't be compatible with React 17, but the newer versions will work...
Read more >Strict Mode - React
Strict mode can't automatically detect side effects for you, but it can help you spot them by making them a little more deterministic....
Read more >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 v17.0 – React Blog
React 17 supports the new JSX transform. We've also backported support for it to React 16.14.0, React 15.7.0, and 0.14.10. Note that it...
Read more >Adopting Concurrent Mode (Experimental) - React
React 18 was released with support for concurrency. However, there is no “mode” ... Concurrent Mode is only available in the experimental builds...
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
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello @harxki, https://github.com/gregberge/svgr/pull/613 takes care of it. Not released yet, but will be part of the next v6-alpha.
Try to upgrade every packages and to use the new templates API. In releases you will find details about it.