Accordion-Collapse-react-native
Accordion-Collapse-react-native copied to clipboard
Any option or prop to default collapsed list
Hi,
Is there any option or prop that can be used to default list to be collapsed on load ?
Could you share an example of the use case you want to achieve and which component are you using?
Hi,
<AccordionList list={this.state.list} header={this._head} body={this._body} keyExtractor={item =>
${item.id}} />
I was using the above snippet in my application, where there was header(of the items in list) and body(contains detail about item). It is working fine but there was an issue where all of the items in the list were unCollapsed. User has to collapse the items manually which behavior wise was bit odd. So i was looking for prop that after setting it all the bodies of the items would be default invisible and will be visible only after clicking header(default behavior). Also i was looking for a way to override header click(a button in header to call function other than toggling body).
The body is by default hidden, no prop needed. If you put a button in the header and map it to a certain behavior the Accordion should not interfere with this scenario.