You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# When generating icons from raw svgs, we need to expose the color value as a prop to make it modifiable in ReactreplaceAttrValues: { "#011e41": "{props.color}", "#adb9c3": "{props.color}" }icon: truedimensions: truetypescript: true
🤔 Expected Behavior
When typescript: true is set in the svgrrc.yaml, the pipeline should process the output of @parcel/transformer-svg-react as TypeScript and output typed definitions of svgs
😯 Current Behavior
The pipeline throws an error on encountering a :, presumably the type definition of the SVG.
I think the proper solution would be setting this to tsx instead if the typescript option is enabled, then it would use the pipeline that is used by all Typescript assets
🐛 bug report
The standard SVG transform pipeline using
@parcel/transformer-svg-react
doesn't understand Typescript emitted by SVGR and assumes it is pure JS.🎛 Configuration (.babelrc, package.json, cli command)
.parcelrc
.svgrrc.yaml
🤔 Expected Behavior
When
typescript: true
is set in the svgrrc.yaml, the pipeline should process the output of@parcel/transformer-svg-react
as TypeScript and output typed definitions of svgs😯 Current Behavior
The pipeline throws an error on encountering a
:
, presumably the type definition of the SVG.💁 Possible Solution
Forcing Parcel to use a Typescript transform in the pipeline resolves the issue and generates proper types for the SVGs
🔦 Context
Generate an Icon library from SVG files that works with a Typescript development environment.
💻 Code Sample
🌍 Your Environment
The text was updated successfully, but these errors were encountered: