react-native-read-more-text
Installation
npm i react-native-read-more-text --save
or with yarn
yarn add react-native-read-more-text
Props
Prop | Type | Required | Note |
---|---|---|---|
onReady |
function |
no | callback function to know when the component is ready |
children |
string |
yes | String to render on read more component |
renderTruncatedFooter |
function |
no | function that will replace the Read more label |
renderRevealedFooter |
function |
no | function that will replace the Hide label |
Usage
;;; Component { let text = thisprops; return <View> <View style=stylescardLabel> <Text style=stylescardLabelText> Description </Text> </View> <View style=stylescard> <View style=stylescardBody> <ReadMore numberOfLines=3 renderTruncatedFooter=this_renderTruncatedFooter renderRevealedFooter=this_renderRevealedFooter onReady=this_handleTextReady> <Text style=stylescardText> text </Text> </ReadMore> </View> </View> </View> ; } { return <Text style=color: ColorstintColor marginTop: 5 onPress=handlePress> Read more </Text> ; } { return <Text style=color: ColorstintColor marginTop: 5 onPress=handlePress> Show less </Text> ; } { // ... }