From 2b8b1942a84f4fac81f2b5715a005bd288da0421 Mon Sep 17 00:00:00 2001 From: Pedro Bern Date: Tue, 26 Jan 2021 12:04:07 -0300 Subject: [PATCH] fix: correct typo "cancelLazyFazeIn" --- src/createCollapsibleTabs.tsx | 20 ++++++++++---------- src/types.ts | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/createCollapsibleTabs.tsx b/src/createCollapsibleTabs.tsx index e1adf142..497207e1 100644 --- a/src/createCollapsibleTabs.tsx +++ b/src/createCollapsibleTabs.tsx @@ -58,7 +58,7 @@ const createCollapsibleTabs = < cancelTranslation, containerStyle, lazy, - cancelLazyFazeIn, + cancelLazyFadeIn, tabBarProps, pagerProps, }) => { @@ -171,7 +171,7 @@ const createCollapsibleTabs = < // set startMounted to initial scene instead of 0, // to support starting on specific tab startMounted={i === 0} - cancelLazyFazeIn={cancelLazyFazeIn} + cancelLazyFadeIn={cancelLazyFadeIn} > {children[i]} @@ -179,7 +179,7 @@ const createCollapsibleTabs = < children[i] ) }, - [children, lazy, tabNames.value, cancelLazyFazeIn] + [children, lazy, tabNames.value, cancelLazyFadeIn] ) const stylez = useAnimatedStyle(() => { @@ -339,12 +339,12 @@ const createCollapsibleTabs = < const Lazy: React.FC<{ name: T startMounted?: boolean - cancelLazyFazeIn?: boolean + cancelLazyFadeIn?: boolean children: React.ReactElement - }> = ({ children, name, startMounted, cancelLazyFazeIn }) => { + }> = ({ children, name, startMounted, cancelLazyFadeIn }) => { const { focusedTab, refMap, scrollY, tabNames } = useTabsContext() const [canMount, setCanMount] = React.useState(!!startMounted) - const opacity = useSharedValue(cancelLazyFazeIn ? 1 : 0) + const opacity = useSharedValue(cancelLazyFadeIn ? 1 : 0) const allowToMount = React.useCallback(() => { // wait the scene to be at least 50 ms focused, before mouting @@ -372,9 +372,9 @@ const createCollapsibleTabs = < const tabIndex = tabNames.value.findIndex((n) => n === name) // @ts-ignore scrollTo(refMap[name], 0, scrollY.value[tabIndex], false) - if (!cancelLazyFazeIn) opacity.value = withTiming(1) + if (!cancelLazyFadeIn) opacity.value = withTiming(1) } - }, [canMount, cancelLazyFazeIn]) + }, [canMount, cancelLazyFadeIn]) const stylez = useAnimatedStyle(() => { return { @@ -383,12 +383,12 @@ const createCollapsibleTabs = < }, []) return canMount ? ( - cancelLazyFazeIn ? ( + cancelLazyFadeIn ? ( children ) : ( {children} diff --git a/src/types.ts b/src/types.ts index 7aca0828..209641c5 100644 --- a/src/types.ts +++ b/src/types.ts @@ -43,7 +43,7 @@ export type CollapsibleProps< containerStyle?: ViewStyle cancelTranslation?: boolean lazy?: boolean - cancelLazyFazeIn?: boolean + cancelLazyFadeIn?: boolean tabBarProps?: Omit> pagerProps?: Omit< RNFlatListProps,