naoufal / react-native-accordion

An Accordion Component for React Native
https://www.npmjs.com/package/react-native-accordion
437 stars 100 forks source link

Footer #8

Closed wheycool closed 8 years ago

wheycool commented 9 years ago

Is it possible (or can you suggest how) to add a footer to the accordion? I'd like the content to be sandwiched between the header and proposed footer. Thanks!

naoufal commented 8 years ago

Hey @wheycool, you could do something like this:

export default class ListRow extends React.Component {
  render() {
    <View>
      <Accordion
        ref="Accordion"
        {...}
      />
      <TouchableHighlight
        onPress={this._handleFooterPress.bind(this)}
      >
        <Text>This is your footer</Text>
      </TouchableHighlight>
    </View>
  }

  _handleFooterPress() {
    this.refs.Accordion.open();
  }
}

Hope that works!