Closed flammenmensch closed 1 year ago
Can you provide a repro? Its working for me in multiple project so probably an issue with an outdated SWC version
Here is the example: https://github.com/flammenmensch/swc-demo It seems that the error occurs only when there are no other props:
<Component<string>>
...
</Component>
This code works fine:
<Component<string> value="Hello world">
...
</Component>
This is a regression in SWC: https://github.com/swc-project/swc/issues/7456
The last working version is 1.3.58
You can pin the version is via the resolutions/overrides: https://docs.npmjs.com/cli/v9/configuring-npm/package-json#overrides
Error
Unexpected token 'RadioGroup'. Expected jsx identifier
when using generics in react components.The following code produces the error above even though it is a valid tsx: