You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npm i @gronda-team/react-native-read-more-text --save
Usage
exportclassDescriptionCardextendsReact.Component{render(){let{ text }=this.props;return(<View><Viewstyle={styles.cardLabel}><BoldTextstyle={styles.cardLabelText}>
Description
</BoldText></View><Viewstyle={styles.card}><Viewstyle={styles.cardBody}><ReadMorenumberOfLines={3}renderTruncatedFooter={this._renderTruncatedFooter}renderRevealedFooter={this._renderRevealedFooter}onReady={this._handleTextReady}><RegularTextstyle={styles.cardText}>{text}</RegularText></ReadMore></View></View></View>);}_renderTruncatedFooter=(handlePress)=>{return(<RegularTextstyle={{color: Colors.tintColor,marginTop: 5}}onPress={handlePress}>
Read more
</RegularText>);}_renderRevealedFooter=(handlePress)=>{return(<RegularTextstyle={{color: Colors.tintColor,marginTop: 5}}onPress={handlePress}>
Show less
</RegularText>);}_handleTextReady=()=>{// ...}}
About
Read More Text component, but also passing up if it should show the more button or not via onReady prop