@kangyoosam/react-native-readmore
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

react-native-readmore

This repository is Fork of(inspired by) https://github.com/expo/react-native-read-more-text

Example

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>
    );
  }
}

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @kangyoosam/react-native-readmore

      Weekly Downloads

      0

      Version

      1.0.2

      License

      MIT

      Unpacked Size

      915 kB

      Total Files

      256

      Last publish

      Collaborators

      • kangyoosam