Aazam Heidari
Aazam Heidari

Reputation: 477

Unable to use reanimated-bottom-sheet in React-Native

I install reanimated-bottom-sheet in my react native project but I faced with this error

TypeError: undefined is not an object (evaluating 'InnerNativeModule.installCoreFunctions') ERROR Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that t frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

this is my code :

import BottomSheet from 'reanimated-bottom-sheet';

const renderContent = () => (
    <View
        style={{
            backgroundColor: 'white',
            padding: 16,
            height: 450,
        }}
    >
        <Text>Swipe down to close</Text>
    </View>
);

const sheetRef = React.useRef(null);

return (
    <SafeAreaView>
        <View
            style={{
                flex: 1,
                backgroundColor: 'papayawhip',
                alignItems: 'center',
                justifyContent: 'center',
            }}
        >
            <Button
                title="Open Bottom Sheet"
                onPress={() => sheetRef.current.snapTo(1)}
            />
        </View>
        <BottomSheet
            ref={sheetRef}
            snapPoints={[450, 300, 0]}
            borderRadius={10}
            renderContent={renderContent}
        />
    </SafeAreaView>
);

Please advise what I am doing wrong.

Thanks in advance

Upvotes: 3

Views: 5347

Answers (1)

Waqas Ahmed
Waqas Ahmed

Reputation: 1411

Current library that you have used will not work with latest react-native-reanimated version.

You have to use react-native-reanimated version 1.x with that.

Or you can use this updated library https://github.com/gorhom/react-native-bottom-sheet

Upvotes: 3

Related Questions