@gorhom/bottom-sheet
Advanced tools
Comparing version 5.0.1 to 5.0.2
@@ -141,3 +141,3 @@ "use strict"; | ||
const animatedNextPosition = (0, _reactNativeReanimated.useSharedValue)(_constants2.INITIAL_VALUE); | ||
const animatedNextPositionIndex = (0, _reactNativeReanimated.useSharedValue)(0); | ||
const animatedNextPositionIndex = (0, _reactNativeReanimated.useSharedValue)(_constants2.INITIAL_VALUE); | ||
@@ -144,0 +144,0 @@ // conditional |
@@ -15,7 +15,7 @@ "use strict"; | ||
let FlashList; | ||
// since FlashList is not a dependency for the library | ||
// we try to import it using metro optional import | ||
try { | ||
FlashList = require('@shopify/flash-list').FlashList; | ||
} catch (_) { | ||
throw 'You need to install FlashList first, `yarn install @shopify/flash-list`'; | ||
} | ||
FlashList = require('@shopify/flash-list'); | ||
} catch (_) {} | ||
const BottomSheetFlashListComponent = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => { | ||
@@ -32,2 +32,8 @@ //#region props | ||
(0, _react.useMemo)(() => { | ||
if (!FlashList) { | ||
throw 'You need to install FlashList first, `yarn install @shopify/flash-list`'; | ||
} | ||
}, []); | ||
//#region render | ||
@@ -52,3 +58,3 @@ const renderScrollComponent = (0, _react.useMemo)(() => /*#__PURE__*/(0, _react.forwardRef)( | ||
}), [focusHook, scrollEventsHandlersHook, enableFooterMarginAdjustment]); | ||
return /*#__PURE__*/_react.default.createElement(FlashList, _extends({ | ||
return /*#__PURE__*/_react.default.createElement(FlashList.FlashList, _extends({ | ||
ref: ref, | ||
@@ -55,0 +61,0 @@ renderScrollComponent: renderScrollComponent |
@@ -131,3 +131,3 @@ import invariant from 'invariant'; | ||
const animatedNextPosition = useSharedValue(INITIAL_VALUE); | ||
const animatedNextPositionIndex = useSharedValue(0); | ||
const animatedNextPositionIndex = useSharedValue(INITIAL_VALUE); | ||
@@ -134,0 +134,0 @@ // conditional |
@@ -8,7 +8,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); } | ||
let FlashList; | ||
// since FlashList is not a dependency for the library | ||
// we try to import it using metro optional import | ||
try { | ||
FlashList = require('@shopify/flash-list').FlashList; | ||
} catch (_) { | ||
throw 'You need to install FlashList first, `yarn install @shopify/flash-list`'; | ||
} | ||
FlashList = require('@shopify/flash-list'); | ||
} catch (_) {} | ||
const BottomSheetFlashListComponent = /*#__PURE__*/forwardRef((props, ref) => { | ||
@@ -25,2 +25,8 @@ //#region props | ||
useMemo(() => { | ||
if (!FlashList) { | ||
throw 'You need to install FlashList first, `yarn install @shopify/flash-list`'; | ||
} | ||
}, []); | ||
//#region render | ||
@@ -45,3 +51,3 @@ const renderScrollComponent = useMemo(() => /*#__PURE__*/forwardRef( | ||
}), [focusHook, scrollEventsHandlersHook, enableFooterMarginAdjustment]); | ||
return /*#__PURE__*/React.createElement(FlashList, _extends({ | ||
return /*#__PURE__*/React.createElement(FlashList.FlashList, _extends({ | ||
ref: ref, | ||
@@ -48,0 +54,0 @@ renderScrollComponent: renderScrollComponent |
@@ -5,5 +5,4 @@ import type { FlashListProps } from '@shopify/flash-list'; | ||
import type { BottomSheetScrollableProps } from './types'; | ||
declare let FlashList: React.FC; | ||
export type BottomSheetFlashListProps<T> = Omit<Animated.AnimateProps<FlashListProps<T>>, 'decelerationRate' | 'onScroll' | 'scrollEventThrottle'> & BottomSheetScrollableProps & { | ||
ref?: Ref<typeof FlashList>; | ||
ref?: Ref<React.FC>; | ||
}; | ||
@@ -10,0 +9,0 @@ export declare const styles: { |
{ | ||
"name": "@gorhom/bottom-sheet", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "A performant interactive bottom sheet with fully configurable options 🚀", | ||
@@ -5,0 +5,0 @@ "main": "lib/commonjs/index", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1200032
19866