I just downloaded the Twilio Flex Sample App and once I add my appConfig and do a npm start I immediately see several errors:
fill-rule
. Did you mean fillRule
?stroke-width
. Did you mean strokeWidth
?stop-color
. Did you mean stopColor
?stop-opacity
. Did you mean stopOpacity
?How can I resolve these? The @twilio/flex-ui project is not on github to post an issue to and the documentation doesn't mention it as a known issue right now.
I fixed it by changing those props in the SVG File. e.g. ‘stroke-width’ into ‘strokeWidth’ or ‘fill-rule’ into ‘fillRule’.
This is happening because the Twilio Flex Sample App was built with Create React App, and React wants multiword names to be in camel case. You may be able to resolve the errors with your Webpack/Babel configs
How do I get rid of react error warnings telling me to change svg attributes to camel case?
Btw I'm confused about what you mean when you say this isn't on GitHub as your link points to a GitHub repo?
you have to change class and fill-rule attributes on the svg tag. it must be className and fillRule. because used camelCase on javascript
Example:
<svg width="2em" height="1em" viewBox="0 0 16 16" **className**="bi bi-cart4" fill="currentColor" xmlns="http://www.w3.org/2000/svg">
<path **fillRule**="evenodd" d="M0 2.5A.5.5 0 0 1 .5 2H2a.5.5 0 0 1 .485.379L2.89 "/>
</svg>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With