我想为我的本机反应应用程序创建一个可滑动和基于内容的高度底部工作表。所以我使用 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>