Accordion Component #5658
Unanswered
ShaneKeney
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hey, I once created an Accordion component a few months ago, I used the measure function to determine the height of its children components. Here's the repository for the accordion I made, you might want to take a look |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was recently building out an accordion component to practice using
react-native-reanimated
. I was able to successfully achieve what I was looking for accomplish so thank you for the great animation library 👏.That being said, I had to workaround something that I didn't quite know how to handle. What I was trying to achieve is to allow the height of the accordion when "opened" to be based off the children dimensions such that I didn't have to statically set the height to the sum of the children heights for specific line items. So...
Accordion "closed":
height: 0
whereas Accordion "open":height: undefined
(thus letting the children dictate the size).When I do this without animation it shows as I want.
How can I achieve this same behavior leveraging an animation? Or, is there a better alternative way to think about solving the problem?
Beta Was this translation helpful? Give feedback.
All reactions