HermSang
HermSang

Reputation: 107

How do you rotate a React-Icon?

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?

Upvotes: 4

Views: 13428

Answers (1)

buzatto
buzatto

Reputation: 10382

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)' }} />

Upvotes: 10

Related Questions