How to rotate font awesome icon in react native?

MD. IBRAHIM KHALIL TANIM picture MD. IBRAHIM KHALIL TANIM · Nov 5, 2019 · Viewed 8.6k times · Source

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;

Answer

Nishant Nair picture Nishant Nair · Nov 5, 2019

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