Skip to content

Commit

Permalink
🛠 Refactor: Move to ModalViewConstants
Browse files Browse the repository at this point in the history
Summary: Move `VirtualizedListContext`, and `hasScrollViewContext` from `src/components/ModalView/ModalView` to `src/components/ModalView/ModalViewConstants`.
  • Loading branch information
dominicstop committed Mar 30, 2023
1 parent b5dba75 commit 544a2d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/components/ModalView/ModalView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,10 @@ import {
ModalViewEventEmitter,
} from './ModalViewEmitter';

//
//

const VirtualizedListContext = React.createContext(null);

// fix for react-native 0.60
const hasScrollViewContext: boolean =
(ScrollView as any).Context?.Provider != null;

//
//
import {
hasScrollViewContext,
VirtualizedListContext,
} from './ModalViewConstants';

// prettier-ignore
export class ModalView extends
Expand Down
8 changes: 8 additions & 0 deletions src/components/ModalView/ModalViewConstants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import React from 'react';
import { ScrollView } from 'react-native';

export const VirtualizedListContext = React.createContext(null);

// fix for react-native 0.60
export const hasScrollViewContext: boolean =
(ScrollView as any).Context?.Provider != null;

0 comments on commit 544a2d6

Please sign in to comment.