react-native-readmore
This repository is Fork of(inspired by) https://github.com/expo/react-native-read-more-text
Installation
npm i --save @kangyoosam/react-native-readmore
or
yarn add kangyoosam/react-native-readmore
Usage
※full code is located at example/App.tsx
file of this repo.
export default class App extends React.Component {
readMore = handlePress => (
<Text style={styles.readMore} onPress={handlePress}>
...ReadMore
</Text>
)
hide = handlePress => {
return null
}
render() {
return (
<View style={styles.container}>
<View style={styles.card}>
<ReadMore
numberOfLines={2}
renderTruncatedFooter={this.readMore}
renderRevealedFooter={this.hide}
>
<Text style={styles.cardText}>
{text}
</Text>
</ReadMore>
</View>
</View>
);
}
}