Suppose I have an icon like this:
<FontAwesome
name={'column'}
size={20}
style={ /* mirror horizontally */ }
/>
How can I mirror this horizontally?
React-native uses an array of transforms according to the docs, the scaleX prop has been deprecated. You can scale transform on the x-axis by the inverse:
style={{
transform: [
{ scaleX: -1 }
]
}}
2 way that you may use to flip or reverse the view of the component through style
fontAwesomeStyle: {
transform: [
{rotateX: '180deg'}, //horizontally
{rotateY: '180deg'} //vertically
{scaleX: -1} //horizontally
{scaleY: -1} //vertically
]
}
but I prefer to use rotate it's because being convenient in terms of animating
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With