naoufal / react-native-accordion

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

Is it possible have only one open item in the list, and close others, when clicking on new row item? #53

Open andrisole92 opened 6 years ago

Zomis commented 6 years ago

Read the documentation (README.md) and you will see that there are methods: open, close and toggle on an Accordion.

That should be all you need to know to be able to implement this yourself.

Try keeping your Accordions in a list and loop over your list and close all of them except the just recently clicked one when an item is clicked.

ishaqashraf commented 6 years ago

@Zomis can you show the example code for this logic