Closed technicallyty closed 5 years ago
What's your use case for this? Cause you can put your code in the onChange
Hi iRoachie, thanks for the response! My use case is this:
I have the possibility of about 200+ objects coming through to my accordion view. They get to my code via sockets. The websocket coll to the API for the names of these things is lightning fast. Less than 100ms. However, to get the individual information (each object can contain about 10 or 15 categories of info) it is much slower, as i have to query each object one by one.
So instead of just getting ALL the possible data in one go, I only want to ask the websocket to get the category data, once the user has clicked on a particular object.
Visual example
-car1-
-car2-
-car3-
-boat1-
-airplane6-
//Clicking on one of these will expand it
-car1-
| make: jeep
| model: cherokee
| year: 1990
| damages?
|| -Front tire blown
|| -radiator broken
| Accident record
-car2-
See this video i made on how to do this using onPress
https://www.loom.com/share/e97dde841afb404da3bda216d17becd1
Ah, got it working, thank you!
What I'm Trying To Do:
I want to add on to the onPress of the components in the accordion, but using "touchableProps" and defining a onPress event, removes the functionality of opening them up.
Why I'm Doing this?
I want onPress to trigger another event, other than opening the accordion.
What I've tried:
This logs test, but no longer opens the accordions. Is there any way I can have onPress do multiple things?