How to rotate font awesome icon in react native?

In my react native application I have a font awesome icon. I want to rotate it. Help is needed.

import React from 'react'
import { View  } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome5';

const InfoBox = () => {
    return (
          <View >
            <Icon name={'hand-holding-usd'} size={20}/>
          </View>

    )
}

export default InfoBox;

Upvotes: 19

Views: 28058

Answers (1)

Nishant Nair
Nishant Nair

Reputation: 2020

You can use the style prop to rotate the icon. Change the degree/direction of rotation as required

<Icon name={'hand-holding-usd'}
      size={20}
      style={{transform: [{rotateY: '180deg'}]}}/>

Upvotes: 45

Related Questions