Swipeable and drawer, new api#3803
Conversation
j-piasecki
left a comment
There was a problem hiding this comment.
Looks like the main changes are due to migration from api v2 to v3. Can we also explore whether we can reduce number of renders using shared value binding?
I've made small adjsutment for swipeable 0f9daeb. I played around a lot with trying to utilise this in drawer, however I could not manage it to work when making |
j-piasecki
left a comment
There was a problem hiding this comment.
I could not manage it to work when making drawerOpened a shared value, we need it to be a state, and all other gesture props depend on it, so I don't think we can utilise it there.
We can always explore refactoring it in the future if there's a chance that it will improve performance.
| // TODO: remove, debug info only | ||
| backgroundColor: 'red', |
There was a problem hiding this comment.
Yeah, hah. Without it the swipeable is all red, so I decided it is time.
| const tapGesture = useTap({ | ||
| shouldCancelWhenOutside: true, | ||
| enabled: shouldEnableTap, | ||
| onStart: () => { | ||
| 'worklet'; | ||
| if (rowState.value !== 0) { | ||
| close(); | ||
| } | ||
| }, | ||
| }); |
There was a problem hiding this comment.
Why don't we pass relation props to Tap?
Description
This PR changes reanimated swipeable and reanimated drawer components implementations to use new hooks API.
Test plan
Check whether 'new swipable' and 'reanimated drawer layout' work in the example app