Skip to content

Conversation

@iRoachie
Copy link
Collaborator

Allows the user to pass in their own Touchable component. Try and it out!

Accordion.js Outdated
PropTypes.number, // sets index of section to open
]),
underlayColor: PropTypes.string,
touchable: PropTypes.func,
Copy link
Owner

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?

Copy link
Collaborator Author

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 😓

@iRoachie
Copy link
Collaborator Author

@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}
Copy link
Owner

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?

Copy link
Collaborator Author

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

Copy link
Owner

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` |
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo, should be TouchableHighlight

@iRoachie iRoachie merged commit bab0156 into next Jul 30, 2017
@iRoachie iRoachie deleted the touchable branch July 30, 2017 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants