We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
When you configure svgr with the following:
then its generating the wrong prop type for the ref. The error is the follwoing:
Type 'Ref' is not assignable to type 'LegacyRef | undefined'.
.svgrc.js
module.exports = { template: require('./template.js'), native: true, typescript: true, ref: true, memo: true, index: true, expandProps: true }
template.js
const template = (variables, { tpl }) => { return tpl` ${variables.imports}; import { useTheme } from '@emotion/react'; ${variables.interfaces}; const ${variables.componentName} = (${variables.props}) => { const theme = useTheme(); return ( ${variables.jsx} ); }; const ForwardRef = forwardRef(${variables.componentName}); const Memo = memo(ForwardRef); export default Memo; `; } module.exports = template;
Should generate the right props.
Everything needed is mentioned in the section above..
## System: - OS: macOS 14.1.1 - CPU: (10) arm64 Apple M1 Pro - Memory: 767.22 MB / 32.00 GB - Shell: 5.9 - /bin/zsh ## Binaries: - Node: 18.16.1 - /opt/homebrew/opt/node@18/bin/node - Yarn: 3.6.4 - /opt/homebrew/opt/node@18/bin/yarn - npm: 9.5.1 - /opt/homebrew/opt/node@18/bin/npm - Watchman: 2023.07.10.00 - /opt/homebrew/bin/watchman
The text was updated successfully, but these errors were encountered:
No branches or pull requests
馃悰 Bug Report
When you configure svgr with the following:
then its generating the wrong prop type for the ref. The error is the follwoing:
To Reproduce
.svgrc.js
template.js
Expected behavior
Should generate the right props.
Link to repl or repo (highly encouraged)
Everything needed is mentioned in the section above..
Envinfo
The text was updated successfully, but these errors were encountered: