Skip to content

Commit

Permalink
fix: add reanimated 2 compatibility to bottom sheet modal
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhom committed Oct 1, 2020
1 parent a608ea5 commit 2d47007
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/bottomSheetModal/BottomSheetModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ import React, {
} from 'react';
import isEqual from 'lodash.isequal';
import { useValue } from 'react-native-redash';
import Animated, {
Extrapolate,
interpolate,
set,
} from 'react-native-reanimated';
import Animated, { Extrapolate, set } from 'react-native-reanimated';
import BottomSheet from '../bottomSheet';
import {
DEFAULT_OVERLAY_OPACITY,
Expand All @@ -23,6 +19,12 @@ import {
} from './constants';
import type { BottomSheetModalType, BottomSheetModalProps } from './types';

const {
interpolate: interpolateV1,
interpolateNode: interpolateV2,
} = require('react-native-reanimated');
const interpolate = interpolateV2 || interpolateV1;

type BottomSheetModal = BottomSheetModalType;

const BottomSheetModalComponent = forwardRef<
Expand Down

0 comments on commit 2d47007

Please sign in to comment.