Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while updating property 'width' in shadow node of type: RNSVGsvgView

I have encountered this error after installing react-native-svg. I have all svg icons in a separate .js file and calling them as follows,

<Icons name={'dot'} style={{height:4, width:4, marginRight:10}} color={"#D8D8D8"}/>

as per this Solution, What ever the values I have given in style object are integers only. But still I am facing this error.

As per this git Solution, some one is asking to downgrade and some one is asking to upgrade react native. But not sure which one gives permanent fix to this error.

Can somebody please let me know root cause of the error and permanent fix for this. Thank You.

like image 726
Mighty Avatar asked Nov 30 '25 21:11

Mighty


1 Answers

as i know this issue happens when you set width and height style to Icon component

you should set size prop to <Icon />

your code should be Like this :

<Icons name={'dot'} size={15} style={{marginRight:10}} color={"#D8D8D8"}/>
like image 89
MoHammaD ReZa DehGhani Avatar answered Dec 03 '25 13:12

MoHammaD ReZa DehGhani



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!