diff --git a/en/react-native-drawer-layout-polyfill.md b/en/react-native-drawer-layout-polyfill.md index 71ca1236bdf492df52f296d8a3721963f2173d57..c2d616cc35074a03841ea358219578135230e7db 100644 --- a/en/react-native-drawer-layout-polyfill.md +++ b/en/react-native-drawer-layout-polyfill.md @@ -13,7 +13,7 @@

-> [!TIP] [GitHub address](https://github.com/rnc-archive/react-native-drawer-layout-polyfill) +> [!TIP] [GitHub address](https://github.com/rnc-archive/react-native-drawer-layout-polyfill/tree/v2.0.0) ## Installation and Usage @@ -54,11 +54,11 @@ const App = () => { const [value, onChangeText] = useState(""); const open = () => { - drawerLayoutRef.current.openDrawer(); + drawerLayoutRef.current?.openDrawer(); }; const close = () => { - drawerLayoutRef.current.closeDrawer(); + drawerLayoutRef.current?.closeDrawer(); }; const changeDrawerPosition = () => { diff --git a/zh-cn/react-native-drawer-layout-polyfill.md b/zh-cn/react-native-drawer-layout-polyfill.md index a0d2d51f9c204d2855718c2061da5cb279dab0ad..aabb041455f05e4a71733095ebcb40b1dd203786 100644 --- a/zh-cn/react-native-drawer-layout-polyfill.md +++ b/zh-cn/react-native-drawer-layout-polyfill.md @@ -13,7 +13,7 @@

-> [!TIP] [Github 地址](https://github.com/rnc-archive/react-native-drawer-layout-polyfill) +> [!TIP] [Github 地址](https://github.com/rnc-archive/react-native-drawer-layout-polyfill/tree/v2.0.0) ## 安装与使用 @@ -54,11 +54,11 @@ const App = () => { const [value, onChangeText] = useState(""); const open = () => { - drawerLayoutRef.current.openDrawer(); + drawerLayoutRef.current?.openDrawer(); }; const close = () => { - drawerLayoutRef.current.closeDrawer(); + drawerLayoutRef.current?.closeDrawer(); }; const changeDrawerPosition = () => {