diff --git a/docs/drawerlayoutandroid.md b/docs/drawerlayoutandroid.md index 84733ebd9ef..478178a41e5 100644 --- a/docs/drawerlayoutandroid.md +++ b/docs/drawerlayoutandroid.md @@ -7,25 +7,66 @@ React component that wraps the platform `DrawerLayout` (Android only). The Drawe Example: -```jsx -render: function() { - var navigationView = ( - - I'm in the Drawer! +```SnackPlayer name=DrawerLayoutAndroid%20Component%20Example&supportedPlatforms=android +import React, { useState } from "react"; +import { Button, DrawerLayoutAndroid, Text, StyleSheet, View } from "react-native"; + +const App = () => { + const [drawerPosition, setDrawerPosition] = useState("left"); + const changeDrawerPosition = () => { + if (drawerPosition === "left") { + setDrawerPosition("right"); + } else { + setDrawerPosition("left"); + } + }; + + const navigationView = ( + + I'm in the Drawer! ); + return ( navigationView}> - - Hello - World! + drawerPosition={drawerPosition} + renderNavigationView={() => navigationView} + > + + + DrawerLayoutAndroid example + +