Skip to content

Commit 9d97690

Browse files
committed
fix: add initialized check
1 parent 182f75c commit 9d97690

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/index.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -704,8 +704,13 @@ export default class BottomSheetBehavior extends React.Component<Props, State> {
704704
)
705705
.sort(({ val: a }, { val: b }) => b - a)
706706
if (state && state.snapPoints) {
707-
state.snapPoints.forEach((s, i) =>
708-
s.setValue(sortedPropsSnapPoints[0].val - sortedPropsSnapPoints[i].val)
707+
state.snapPoints.forEach(
708+
(s, i) =>
709+
// @ts-ignore
710+
s.__initialized &&
711+
s.setValue(
712+
sortedPropsSnapPoints[0].val - sortedPropsSnapPoints[i].val
713+
)
709714
)
710715
snapPoints = state.snapPoints
711716
} else {

0 commit comments

Comments
 (0)