Skip to content

Commit

Permalink
fix: always update container height to avoid races. (#919)(by @elan)
Browse files Browse the repository at this point in the history
Updating a shared values is an asynchronous operation, so if two layouts happen in quick succession, we can miss an update.
  • Loading branch information
elan authored Apr 21, 2022
1 parent 0010008 commit 3245b23
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/bottomSheetContainer/BottomSheetContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ function BottomSheetContainerComponent({
layout: { height },
},
}: LayoutChangeEvent) {
if (height !== containerHeight.value) {
containerHeight.value = height;
}
containerHeight.value = height;

containerRef.current?.measure(
(_x, _y, _width, _height, _pageX, pageY) => {
Expand Down

0 comments on commit 3245b23

Please sign in to comment.