You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/drawer-layout.md
+10-29
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ title: React Native Drawer Layout
4
4
sidebar_label: Drawer Layout
5
5
---
6
6
7
-
A cross-platform Drawer component for React Native implemented using [`react-native-gesture-handler`](https://docs.swmansion.com/react-native-gesture-handler/) and [`react-native-reanimated`](https://docs.swmansion.com/react-native-reanimated/).
7
+
A cross-platform Drawer component for React Native implemented using [`react-native-gesture-handler`](https://docs.swmansion.com/react-native-gesture-handler/) and [`react-native-reanimated`](https://docs.swmansion.com/react-native-reanimated/) on native platforms and CSS transitions on Web.
8
8
9
9
<videoplaysInlineautoPlaymutedloop>
10
10
<sourcesrc="/assets/7.x/drawer-layout.mp4" />
@@ -55,7 +55,7 @@ Then, you need to install and configure the libraries that are required by the d
55
55
import'./gesture-handler';
56
56
```
57
57
58
-
Since the drawer layout doesn't use `react-native-gesture-handler` on the web, this avoids unnecessarily increasing the bundle size.
58
+
Since the drawer layout doesn't use `react-native-gesture-handler` on Web, this avoids unnecessarily increasing the bundle size.
59
59
60
60
:::warning
61
61
@@ -106,7 +106,7 @@ The package exports a `Drawer` component which is the one you'd use to render th
106
106
107
107
### `Drawer`
108
108
109
-
Component responsible for rendering a drawer with animations and gestures.
109
+
Component is responsible for rendering a drawer sidebar with animations and gestures.
110
110
111
111
#### Drawer Props
112
112
@@ -212,7 +212,7 @@ Content that the drawer should wrap.
212
212
213
213
### `useDrawerProgress`
214
214
215
-
The `useDrawerProgress` hook returns a Reanimated SharedValue (with modern implementation) or Reanimated Node (with legacy implementation) which represents the progress of the drawer. It can be used to animate the content of the screen.
215
+
The `useDrawerProgress` hook returns a Reanimated `SharedValue` which represents the progress of the drawer. It can be used to animate the content of the screen.
If you are using class components, you can use the `DrawerProgressContext` to get the progress value.
268
243
269
244
```js
@@ -281,3 +256,9 @@ class MyComponent extends React.Component {
281
256
}
282
257
}
283
258
```
259
+
260
+
:::warning
261
+
262
+
The `useDrawerProgress` hook (or `DrawerProgressContext`) will return a mock value on Web since Reanimated is not used on Web. The mock value can only represent the open state of the drawer (`0` when closed, `1` when open), and not the progress of the drawer.
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/drawer-navigator.md
+7-1
Original file line number
Diff line number
Diff line change
@@ -762,7 +762,13 @@ export default function App() {
762
762
</TabItem>
763
763
</Tabs>
764
764
765
-
This hook is not supported on Web.
765
+
If you are using class components, you can use the `DrawerProgressContext` to get the progress value.
766
+
767
+
:::warning
768
+
769
+
The `useDrawerProgress` hook (or `DrawerProgressContext`) will return a mock value on Web since Reanimated is not used on Web. The mock value can only represent the open state of the drawer (`0` when closed, `1` when open), and not the progress of the drawer.
0 commit comments