Skip to content

Commit ab84048

Browse files
tbobaja1ns
authored andcommitted
fix: move GHContext from gesture-handler to native-stack (software-mansion#2017)
## Description Unfortunately, because of changing the way how we export the components, I didn't saw the wrong export of GHContext in gesture-handler's `index.tsx` file. To match the changes from the PR with full screen swipe (software-mansion#1913), I've created the directory in a wrong place. This PR fixes this export by moving the context to native-stack and removing the export from the gesture-handler/index.tsx. I'm also removing this export, because right now it's possible to import GHContext from `react-native-screens` and also from `react-native-screens/gesture-handler` which is wrong. ## Changes - Changed the export of GHContext in index.tsx - Moved GHContext from gesture-handler to native-stack ## Test code and steps to reproduce Try to build and run TestsExample - see if the bundling state passes correctly. Then, try to import GestureDetectorProvider and wrap whole navigator in it. ## Checklist - [X] Included code example that can be used to test this change - [x] Ensured that CI passes
1 parent d3189c9 commit ab84048

File tree

4 files changed

+4
-9
lines changed

4 files changed

+4
-9
lines changed

src/gesture-handler/GestureDetectorProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { GHContext } from './context/GHContext';
2+
import { GHContext } from 'react-native-screens';
33
import ScreenGestureDetector from './ScreenGestureDetector';
44
import type { GestureProviderProps } from '../native-stack/types';
55

src/gesture-handler/index.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/*
2-
* Context
3-
*/
4-
export { GHContext } from './context/GHContext';
5-
61
/*
72
* Providers
83
*/

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ export { default as FullWindowOverlay } from './components/FullWindowOverlay';
5353
export { default as NativeScreensModule } from './fabric/NativeScreensModule';
5454

5555
/*
56-
* Gesture Handler
56+
* Contexts
5757
*/
58-
export { GHContext } from './gesture-handler';
58+
export { GHContext } from './native-stack/contexts/GHContext';
5959

6060
/*
6161
* Utils

src/gesture-handler/context/GHContext.tsx renamed to src/native-stack/contexts/GHContext.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { PropsWithChildren } from 'react';
2-
import { GestureProviderProps } from '../../native-stack/types';
2+
import { GestureProviderProps } from '../types';
33

44
// context to be used when the user wants full screen swipe (see `gesture-handler` folder in repo)
55
export const GHContext = React.createContext(

0 commit comments

Comments
 (0)