gorhom / react-native-bottom-sheet

A performant interactive bottom sheet with fully configurable options 🚀
https://gorhom.dev/react-native-bottom-sheet/
MIT License
6.9k stars 752 forks source link

Failed building javascript bundle #342

Closed darmane closed 3 years ago

darmane commented 3 years ago

Bug

Hi! I'm having this error in my app react native app with expo. This is the error tray:

Failed building JavaScript bundle. Unable to resolve module ./hooks/useBottomSheetSpringConfigs from D:\development\ReactProjects\cat-reminders\node_modules\@gorhom\bottom-sheet\src\index.ts:

None of these files exist:

1 | export { default } from './components/bottomSheet'; 2 | 3 | // scrollables 4 | export { default as BottomSheetFlatList } from './components/flatList';

Environment info

Library Version
@gorhom/bottom-sheet ^2.2.4
react-native 0.63.2
react-native-reanimated ~1.13.0
react-native-gesture-handler ~1.8.0

Steps To Reproduce

  1. npm i @gorhom/bottom-sheet
  2. write some code importing the library
  3. run in android with expo

Describe what you expected to happen:

  1. Run without errors

Reproducible sample code

Here is my code with this library.


import React, { useEffect } from "react"; // native components import { StyleSheet } from "react-native"; // ui components import { View, Text } from "react-native-ui-lib"; import BottomSheet from "@gorhom/bottom-sheet"; // styles import { Colors } from "./styles";

const AvatarsBottomSheet = ({ visible }: Props) => { // sheet ref const sheet = React.createRef();

// sheet content const renderContent = () => { return (

HI
);

};

return ( <BottomSheet ref={sheet} index={1} snapPoints={[-1, "60%"]} children={renderContent} /> ); };

const styles = StyleSheet.create({ header: { height: 40, borderTopLeftRadius: 30, borderTopRightRadius: 30, alignItems: "center", justifyContent: "flex-end", backgroundColor: Colors.SECONDARY, }, slot: { width: 40, height: 8, borderRadius: 4, marginBottom: 10, backgroundColor: Colors.PRIMARY, }, panel: { backgroundColor: Colors.SECONDARY, }, });

interface Props { visible: boolean; }

export default AvatarsBottomSheet;

gorhom commented 3 years ago

hi @darmane , useBottomSheetSpringConfigs is only available for v3 ! please remove the library and install it again and make sure to clear metro cache