react-native-drawer-layout 4.0.0 → 4.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-drawer-layout",
3
3
  "description": "Drawer component for React Native",
4
- "version": "4.0.0",
4
+ "version": "4.0.2",
5
5
  "keywords": [
6
6
  "react-native-component",
7
7
  "react-component",
@@ -52,8 +52,8 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "del-cli": "^5.1.0",
55
- "react": "18.2.0",
56
- "react-native": "0.74.5",
55
+ "react": "18.3.1",
56
+ "react-native": "0.76.2",
57
57
  "react-native-builder-bob": "^0.29.0",
58
58
  "typescript": "^5.5.2"
59
59
  },
@@ -88,5 +88,5 @@
88
88
  ]
89
89
  ]
90
90
  },
91
- "gitHead": "25964f799b3abe103a58e2e321790cfa85e4067b"
91
+ "gitHead": "9ed7f88db02bf6b2565d575f79bd2feb0ceae1fa"
92
92
  }
@@ -20,6 +20,14 @@ class FakeSharedValue {
20
20
  this.value = modifier !== undefined ? modifier(this.value) : this.value;
21
21
  }
22
22
 
23
+ get() {
24
+ return this.value;
25
+ }
26
+
27
+ set(value: number) {
28
+ this.value = value;
29
+ }
30
+
23
31
  set value(value: number) {
24
32
  this._value = value;
25
33
 
@@ -219,19 +219,23 @@ export function Drawer({
219
219
 
220
220
  let pan = Gesture?.Pan()
221
221
  .onBegin((event) => {
222
+ 'worklet';
222
223
  startX.value = translationX.value;
223
224
  gestureState.value = event.state;
224
225
  touchStartX.value = event.x;
225
226
  })
226
227
  .onStart(() => {
228
+ 'worklet';
227
229
  runOnJS(onGestureBegin)();
228
230
  })
229
231
  .onChange((event) => {
232
+ 'worklet';
230
233
  touchX.value = event.x;
231
234
  translationX.value = startX.value + event.translationX;
232
235
  gestureState.value = event.state;
233
236
  })
234
237
  .onEnd((event, success) => {
238
+ 'worklet';
235
239
  gestureState.value = event.state;
236
240
 
237
241
  if (!success) {
@@ -330,7 +334,14 @@ export function Drawer({
330
334
  },
331
335
  ],
332
336
  };
333
- });
337
+ }, [
338
+ direction,
339
+ drawerPosition,
340
+ drawerType,
341
+ drawerWidth,
342
+ layout.width,
343
+ translateX,
344
+ ]);
334
345
 
335
346
  const contentAnimatedStyle = useAnimatedStyle(() => {
336
347
  return {
@@ -350,7 +361,7 @@ export function Drawer({
350
361
  },
351
362
  ],
352
363
  };
353
- });
364
+ }, [drawerPosition, drawerType, drawerWidth, translateX]);
354
365
 
355
366
  const progress = useDerivedValue(() => {
356
367
  return drawerType === 'permanent'
@@ -22,7 +22,7 @@ export function Overlay({
22
22
  // We can send the overlay behind the screen to avoid it
23
23
  zIndex: progress.value > PROGRESS_EPSILON ? 0 : -1,
24
24
  };
25
- });
25
+ }, [progress]);
26
26
 
27
27
  const animatedProps = useAnimatedProps(() => {
28
28
  const active = progress.value > PROGRESS_EPSILON;
@@ -32,7 +32,7 @@ export function Overlay({
32
32
  accessibilityElementsHidden: !active,
33
33
  importantForAccessibility: active ? 'auto' : 'no-hide-descendants',
34
34
  } as const;
35
- });
35
+ }, [progress]);
36
36
 
37
37
  return (
38
38
  <Animated.View