stanleyugwu/react-native-bottom-sheet

Modifying typescript example

RattyJhay opened this issue ยท 1 comments

There are some errors in your typescript examples. first there are no parent element and the second is sheetRef.current could be null.
This is my modification.

import React, { useRef } from "react";
import BottomSheet, { BottomSheetMethods } from "@devvie/bottom-sheet";
import { Button, Text } from "react-native";

const App= () => {
const sheetRef = useRef(null);
return (
<>
<Button title="Open" onPress={() => sheetRef.current?.open()} />


The smart ๐Ÿ˜Ž, tiny ๐Ÿ“ฆ, and flexible ๐ŸŽ— bottom sheet your app craves ๐Ÿš€


</>
);
};

export default App;

this is the fix:

Thanks for spotting and reporting this mistake, a fix is on its way to main branch already, thanks to you ๐Ÿš€