-
-
Notifications
You must be signed in to change notification settings - Fork 451
Touchable as Prop #108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Touchable as Prop #108
Conversation
Accordion.js
Outdated
| PropTypes.number, // sets index of section to open | ||
| ]), | ||
| underlayColor: PropTypes.string, | ||
| touchable: PropTypes.func, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps name this touchableComponent and maybe also support touchableProps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright! Lol forgot the props 😓
|
@oblador Changes made, also updated readme. If this is good, will merge this into next and release 0.9 |
| <Touchable | ||
| onPress={() => this._toggleSection(key)} | ||
| underlayColor={this.props.underlayColor} | ||
| {...this.props.touchableProps} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this needs to have a default of empty object otherwise it will crash for undefined values. Did you try this code runtime?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea I tested on the example app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, I guess JSX spreads work differently than regular object spreads then. Fix the README typo and we're good to go 👍
README.md
Outdated
| |**`initiallyActiveSection`**|Set which index in the `sections` array is initially open. Defaults to none. | | ||
| |**`activeSection`**|Control which index in the `sections` array is currently open. Defaults to none. If false, closes all sections.| | ||
| |**`underlayColor`**|The color of the underlay that will show through when tapping on headers. Defaults to black. | | ||
| |**`touchableComponent`**| The touchable component used in the Accordion. Defaults to `TouchableHight` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo, should be TouchableHighlight
Allows the user to pass in their own Touchable component. Try and it out!