Home > Back-end >  Creating toggle function for multiple elements in React Native
Creating toggle function for multiple elements in React Native

Time:11-20

I created two dropdown lists by creating two separate functions. But it makes my code too clumsy, especially if I will add more lists on the screen. Here is my code:

https://snack.expo.dev/bhceYoSTC

Can someone help me to combine my functions to one which after clicking will open lists and change icons separately , but not two lists at one time?

Thank you in advance

CodePudding user response:

Check this out, https://snack.expo.dev/3fvb0OERM

Hope this work for you now.

  • Related