Recently for work I created a react component where I was passing in an SVG as a prop. Everything looked good in chrome, but when I tested in safari I realized my SVGs weren't showing up.
Afterconsole.log
ing to make sure the prop was passed in correctly I eventually realized the SVG would only render when aheight
attribute was specified in the component being passed in.
constHeader=()=>{<Menulinks={[{itemName:'account settings'SVG:<AccountIconheight="20rem"/>}]}}
Another option is to define theclassName
of the SVG in the parent component and add styling in the child where it's being rendered.
constHeader=()=>{<Menulinks={[{itemName:'account settings'SVG:<AccountIconclassName="svg-icon"/>}]}}
Top comments(0)
Subscribe
For further actions, you may consider blocking this person and/orreporting abuse