Sometimes, we want to fix textDecoration properties not working on Android with React Native.
In this article, we’ll look at how to fix textDecoration properties not working on Android with React Native.
How to fix textDecoration properties not working on Android with React Native?
To fix textDecoration properties not working on Android with React Native, we can set the textDecorationLine
, textDecorationStyle
and textDecorationColor
styles.
For instance, we write:
import * as React from 'react';
import { Text, View } from 'react-native';
import Constants from 'expo-constants';
import { Card } from 'react-native-paper';
export default function App() {
return (
<View>
<Text
style={{
textDecorationLine: 'underline',
textDecorationStyle: 'solid',
textDecorationColor: '#000',
}}>
hello
</Text>
</View>
);
}
to set textDecorationLine
to 'underline'
to add text underline.
textDecorationStyle
set to 'solid'
makes the underline solid.
textDecorationColor
set the underline color.
Conclusion
To fix textDecoration properties not working on Android with React Native, we can set the textDecorationLine
, textDecorationStyle
and textDecorationColor
styles.