Modifying typescript example
RattyJhay opened this issue ยท 1 comments
RattyJhay commented
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:
stanleyugwu commented
Thanks for spotting and reporting this mistake, a fix is on its way to main
branch already, thanks to you ๐