Skip to content

Commit

Permalink
fix: don't force legacy implementation on chrome debugger
Browse files Browse the repository at this point in the history
Reanimated 2 now supports chrome debugging, so we don't need to force legacy implementation.
  • Loading branch information
satya164 committed Mar 25, 2022
1 parent 08c61ad commit 94730e0
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 15 deletions.
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"react-native-gesture-handler": "~2.2.0",
"react-native-pager-view": "5.4.9",
"react-native-paper": "^4.9.1",
"react-native-reanimated": "~2.3.1",
"react-native-reanimated": "~2.4.1",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"react-native-tab-view": "^3.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/drawer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"react-native": "~0.64.3",
"react-native-builder-bob": "^0.18.1",
"react-native-gesture-handler": "~2.2.0",
"react-native-reanimated": "~2.3.1",
"react-native-reanimated": "~2.4.1",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"typescript": "^4.3.2"
Expand Down
6 changes: 3 additions & 3 deletions packages/drawer/src/types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ export type DrawerNavigationConfig = {
* The new implementation based on Reanimated 2 will perform better,
* but you need additional configuration and need to use Hermes with Flipper to debug.
*
* This defaults to `true` in following cases:
* - Reanimated 2 is not configured
* - App is connected to Chrome debugger (Reanimated 2 cannot be used with Chrome debugger)
* This defaults to `true` if Reanimated 2 is not configured.
*
* Otherwise, it defaults to `false`
*/
Expand Down Expand Up @@ -152,6 +150,8 @@ export type DrawerNavigationOptions = HeaderOptions & {
* - `back`: The drawer is revealed behind the screen on swipe.
* - `slide`: Both the screen and the drawer slide on swipe to reveal the drawer.
* - `permanent`: A permanent drawer is shown as a sidebar.
*
* Defaults to `slide` on iOS and `front` on other platforms.
*/
drawerType?: 'front' | 'back' | 'slide' | 'permanent';

Expand Down
9 changes: 3 additions & 6 deletions packages/drawer/src/views/DrawerView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,9 @@ function DrawerViewBase({
detachInactiveScreens = Platform.OS === 'web' ||
Platform.OS === 'android' ||
Platform.OS === 'ios',
// Running in chrome debugger
// @ts-expect-error
useLegacyImplementation = !global.nativeCallSyncHook ||
// Reanimated 2 is not configured
// @ts-expect-error: the type definitions are incomplete
!Reanimated.isConfigured?.(),
// Reanimated 2 is not configured
// @ts-expect-error: the type definitions are incomplete
useLegacyImplementation = !Reanimated.isConfigured?.(),
}: Props) {
const Drawer: React.ComponentType<DrawerProps> = useLegacyImplementation
? require('./legacy/Drawer').default
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17587,10 +17587,10 @@ react-native-paper@^4.9.1:
color "^3.1.2"
react-native-iphone-x-helper "^1.3.1"

react-native-reanimated@~2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.3.1.tgz#c7abad48f9e6c84610b0d5e270088ecd61750382"
integrity sha512-nzjVqwkB8eeyPKT2KoiA9EEz17ZMFSGMoOTC17Z9b5nE2Z4ZHjHM5EKhY0TlwzXFUuJAE9PhOfxF0wIO/maZSA==
react-native-reanimated@~2.4.1:
version "2.4.1"
resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.4.1.tgz#4e33876fba525ce60ac13ab3c81fc3a9f8b132fe"
integrity sha512-kvf7ylGlwa5hxMQ+wpPFjQrI2c6eexf53/xRo+dvXBNefGmSYaYR5sFtD0XMMzIPQlkCB9tJ0Pu9+2WCQUY7Cg==
dependencies:
"@babel/plugin-transform-object-assign" "^7.10.4"
"@types/invariant" "^2.2.35"
Expand Down

0 comments on commit 94730e0

Please sign in to comment.