npm react-native-collapsible 1.0.0

latest releases: 1.6.0, 1.5.3, 1.5.2...
4 years ago

Multiple Expanded Sections are here!

One of the most requested features was added in this release - the ability to have open multiple sections in the Accordion. Be sure to check the example app to see it in action.

To facilitate this; two new props were added.
expandMultiple - Allows expanding multiple sections
activeSections - An array of active sections (index)

Props to @jdonald 🎉

⚠️ Breaking Changes ⚠️

All the changes below are for the Accordion

activeSection is now deprecated.

Since we allow for multiple sections now, you'll need to use the new activeSections prop instead which is an array of indices.

<Accordion activeSection={0} /><Accordion activeSections={[0]} />

onChange now returns an array of indices.

Previously onChange would've returned the current index that was active. This change is related to multiple expanded sections.

<Accordion onChange={section => // 0} /><Accordion onChange={sections => // [0]} />

initiallyActiveSection is now deprecated.

Setting an initial section to be active is now as easy as using setting the activeSections prop to the index you want.

<Accordion initialActiveSection={2} /><Accordion activeSections={[2]} />


  • Updated Example app to expo sdk v30

Don't miss a new react-native-collapsible release

NewReleases is sending notifications on new releases.