0

I am using react-native-collapsible for a project. Everything working well but I would like the user to be able to close the collapsible by clicking anywhere on the screen when it is opened. On a desktop it would be easy with a !event.target match but since I am new to React Native (expo) I am a bit out of solution. Thanks a lot, I pasted no code because I am currently using the Lorem example from the lib so won't be much useful.

mdc123
  • 196
  • 1
  • 10

1 Answers1

0

You can Make one useState variable and pass it into the property of collapsed={Your useState Veriable} react-native-collapsible . also make all the Design wrap into TouchableOpacity and it's onPress event to make it true.

Ankit Vora
  • 568
  • 2
  • 12