React Native Gorhom bottom sheet 属性值未定义

问题描述 投票:0回答:0

我想为我的本机反应应用程序创建一个可滑动和基于内容的高度底部工作表。所以我使用 gorhom bottom sheet 但它在 animatedIndex.value 中显示错误属性值 undefined 我想看看完整代码GORHOM BOTTOM SHEET

BottomSheet.tsx

  const containerStyle = useMemo(() => [styles.header, style], [style]);
  const containerAnimatedStyle = useAnimatedStyle(() => {
    const borderTopRadius = interpolate(
      animatedIndex.value,
      [1, 2],
      [20, 0],
      Extrapolate.CLAMP
    );
    return {
      borderTopLeftRadius: borderTopRadius,
      borderTopRightRadius: borderTopRadius,
    };
  });
  const leftIndicatorStyle = useMemo(
    () => ({
      ...styles.indicator,
      ...styles.leftIndicator,
    }),
    []
  );

我只是在我的 Main App.js 文件中导入底部的 Sheets

App.js

<GestureHandlerRootView style={{ flex: 1 }}>
      <BottomSheets/>
    </GestureHandlerRootView>
react-native bottom-sheet
© www.soinside.com 2019 - 2024. All rights reserved.