#reactnative
question: is this an acceptable way to use RNGH? I don't want the identity of `nativeGesture` to change, so as `drawerGesture` changes I just keep adding them endlessly in an effect
seems cursed but fixes a gnarly perf problem!
If the drawer changes frequently this could be a problem. The native gesture will be accumulating all the previous drawer gesture references which may become too big. It actually only keeps the id so each one wont contribute a lot but if it grows indefinitely it could be a problem
1 1Another way to do it is to keep the drawer gesture references which may stable too with useMemo and only co figure it once. You can reassign the gesture instance to new components and I think you should be able to event have it used in two different components at the same time
1 1Can’t you make the reference stable with useMemo though and just reconfigure it when needed?
1 1As for that one I’m not so sure, it may just add another handler when you call it for the second time. Would need to check
1 1Samuel
@samuel.fm
ah ok never mind then. the issue is, the drawer gesture needs the `open` state in the onEnd handler, and thus `open` is a dependency of the gesture's useMemo. every time the drawer opens and closes, the gesture needs to be recreated in order to pass in the `open` state
1