Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you rotate a React-Icon?

Tags:

reactjs

I have looked at different solutions on SO, but nothing has worked so far, and I couldn't find anything in the documentation. I have done things like:

in my Icon context provider:

style:{transform: [{ rotate: '90deg' }]}

as well as inserting the style directly into the icon tag like:

<BiCard style = {{transform: [{ rotate: '90deg' }]}}>

But none of this seems to be working. I have tried rotateX and rotateY as well. Is there some newer way to do this?

like image 568
HermSang Avatar asked Sep 04 '26 21:09

HermSang


1 Answers

you should pass a string to your transform property not an array.

If you pass as below it should work as expected:

<BiCard style = {{transform: 'rotate(90deg)' }} />
like image 86
buzatto Avatar answered Sep 06 '26 09:09

buzatto



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!