diff --git a/apps/common-app/src/App.tsx b/apps/common-app/src/App.tsx index 75b151dd6eb..4d682e28aad 100644 --- a/apps/common-app/src/App.tsx +++ b/apps/common-app/src/App.tsx @@ -15,24 +15,14 @@ import { GestureHandlerRootView, RectButton, } from 'react-native-gesture-handler'; -import { - HeaderBackButton, - HeaderBackButtonProps, -} from '@react-navigation/elements'; -import { - NativeStackNavigationProp, - createNativeStackNavigator, -} from '@react-navigation/native-stack'; -import { - NavigationContainer, - NavigationProp, - PathConfigMap, - useNavigation, -} from '@react-navigation/native'; -import { - StackNavigationProp, - createStackNavigator, -} from '@react-navigation/stack'; +import type { HeaderBackButtonProps } from '@react-navigation/elements'; +import { HeaderBackButton } from '@react-navigation/elements'; +import type { NativeStackNavigationProp } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; +import type { NavigationProp, PathConfigMap } from '@react-navigation/native'; +import { NavigationContainer, useNavigation } from '@react-navigation/native'; +import type { StackNavigationProp } from '@react-navigation/stack'; +import { createStackNavigator } from '@react-navigation/stack'; import AsyncStorage from '@react-native-async-storage/async-storage'; import { EXAMPLES } from './examples'; @@ -53,7 +43,7 @@ interface HomeScreenProps { | NativeStackNavigationProp; } -const EXAMPLES_NAMES = Object.keys(EXAMPLES) as (keyof typeof EXAMPLES)[]; +const EXAMPLES_NAMES = Object.keys(EXAMPLES); function findExamples(search: string) { if (search === '') { @@ -181,7 +171,7 @@ function BackButton(props: HeaderBackButtonProps) { const PERSISTENCE_KEY = 'NAVIGATION_STATE_V1'; export default function App() { - const [isReady, setIsReady] = React.useState(__DEV__ ? false : true); + const [isReady, setIsReady] = React.useState(!__DEV__); const [initialState, setInitialState] = React.useState(); React.useEffect(() => { diff --git a/apps/common-app/src/examples/AnimatedTabBarExample.tsx b/apps/common-app/src/examples/AnimatedTabBarExample.tsx index 62dc6622245..0b2ee0d74fb 100644 --- a/apps/common-app/src/examples/AnimatedTabBarExample.tsx +++ b/apps/common-app/src/examples/AnimatedTabBarExample.tsx @@ -24,7 +24,7 @@ import { } from '@fortawesome/free-solid-svg-icons'; import Svg, { Path } from 'react-native-svg'; import * as shape from 'd3-shape'; -import { IconProp } from '@fortawesome/fontawesome-svg-core'; +import type { IconProp } from '@fortawesome/fontawesome-svg-core'; const { width, height } = Dimensions.get('window'); diff --git a/apps/common-app/src/examples/ChatHeadsExample.tsx b/apps/common-app/src/examples/ChatHeadsExample.tsx index 5b8293978ad..d5e7926496a 100644 --- a/apps/common-app/src/examples/ChatHeadsExample.tsx +++ b/apps/common-app/src/examples/ChatHeadsExample.tsx @@ -8,10 +8,8 @@ import Animated, { withSpring, clamp, } from 'react-native-reanimated'; -import { - PanGestureHandler, - PanGestureHandlerGestureEvent, -} from 'react-native-gesture-handler'; +import type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler'; +import { PanGestureHandler } from 'react-native-gesture-handler'; const { width: windowWidth, height: windowHeight } = Dimensions.get('window'); diff --git a/apps/common-app/src/examples/ComposedHandlerInternalMergingExample.tsx b/apps/common-app/src/examples/ComposedHandlerInternalMergingExample.tsx index 256585ffb40..723dc248089 100644 --- a/apps/common-app/src/examples/ComposedHandlerInternalMergingExample.tsx +++ b/apps/common-app/src/examples/ComposedHandlerInternalMergingExample.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { Text, View, StyleSheet } from 'react-native'; import type { NativeSyntheticEvent, NativeScrollEvent } from 'react-native'; +import type { EventHandlerProcessed } from 'react-native-reanimated'; import Animated, { - EventHandlerProcessed, interpolateColor, useAnimatedScrollHandler, useAnimatedStyle, diff --git a/apps/common-app/src/examples/CubesExample.tsx b/apps/common-app/src/examples/CubesExample.tsx index 864f676c3f2..7153db8ab2e 100644 --- a/apps/common-app/src/examples/CubesExample.tsx +++ b/apps/common-app/src/examples/CubesExample.tsx @@ -222,7 +222,7 @@ function CubeWithEulerAngles() { transformOrigin(matrix, origin); return { - transform: [{ perspective: 1000 }, { matrix: matrix }], + transform: [{ perspective: 1000 }, { matrix }], backgroundColor: sidesColors[i], }; }) @@ -261,7 +261,7 @@ function CubeWithQuaternions() { transformOrigin(matrix, origin); return { - transform: [{ perspective: 1000 }, { matrix: matrix }], + transform: [{ perspective: 1000 }, { matrix }], backgroundColor: sidesColors[i], }; }) diff --git a/apps/common-app/src/examples/CustomHandler/AnimatedText.tsx b/apps/common-app/src/examples/CustomHandler/AnimatedText.tsx index 91ea48683f7..a3d549996a8 100644 --- a/apps/common-app/src/examples/CustomHandler/AnimatedText.tsx +++ b/apps/common-app/src/examples/CustomHandler/AnimatedText.tsx @@ -1,16 +1,8 @@ import React from 'react'; -import { - StyleProp, - StyleSheet, - TextInput, - TextInputProps, - TextStyle, -} from 'react-native'; -import Animated, { - SharedValue, - useAnimatedProps, -} from 'react-native-reanimated'; -import type { AnimatedStyle } from 'react-native-reanimated'; +import type { StyleProp, TextInputProps, TextStyle } from 'react-native'; +import { StyleSheet, TextInput } from 'react-native'; +import Animated, { useAnimatedProps } from 'react-native-reanimated'; +import type { AnimatedStyle, SharedValue } from 'react-native-reanimated'; Animated.addWhitelistedNativeProps({ text: true }); diff --git a/apps/common-app/src/examples/CustomHandler/PagerExample.tsx b/apps/common-app/src/examples/CustomHandler/PagerExample.tsx index 264fed1c9d8..ee5119dee98 100644 --- a/apps/common-app/src/examples/CustomHandler/PagerExample.tsx +++ b/apps/common-app/src/examples/CustomHandler/PagerExample.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { StyleSheet, Text, View } from 'react-native'; +import type { SharedValue } from 'react-native-reanimated'; import Animated, { - SharedValue, useDerivedValue, useSharedValue, } from 'react-native-reanimated'; diff --git a/apps/common-app/src/examples/CustomHandler/useAnimatedPagerHandler.ts b/apps/common-app/src/examples/CustomHandler/useAnimatedPagerHandler.ts index 11bdb114d01..0e7fa68a6c2 100644 --- a/apps/common-app/src/examples/CustomHandler/useAnimatedPagerHandler.ts +++ b/apps/common-app/src/examples/CustomHandler/useAnimatedPagerHandler.ts @@ -1,4 +1,4 @@ -import { +import type { PageScrollStateChangedNativeEvent, PagerViewOnPageScrollEvent, PagerViewOnPageSelectedEvent, diff --git a/apps/common-app/src/examples/DragAndSnapExample.tsx b/apps/common-app/src/examples/DragAndSnapExample.tsx index 46ce27a964b..16434f8f49b 100644 --- a/apps/common-app/src/examples/DragAndSnapExample.tsx +++ b/apps/common-app/src/examples/DragAndSnapExample.tsx @@ -8,10 +8,8 @@ import Animated, { interpolate, Extrapolation, } from 'react-native-reanimated'; -import { - PanGestureHandler, - PanGestureHandlerGestureEvent, -} from 'react-native-gesture-handler'; +import type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler'; +import { PanGestureHandler } from 'react-native-gesture-handler'; export default function DragAndSnapExample() { const translation = { diff --git a/apps/common-app/src/examples/EmojiWaterfallExample.tsx b/apps/common-app/src/examples/EmojiWaterfallExample.tsx index b7d2c353a2f..163a2b56b92 100644 --- a/apps/common-app/src/examples/EmojiWaterfallExample.tsx +++ b/apps/common-app/src/examples/EmojiWaterfallExample.tsx @@ -1,6 +1,6 @@ +import type { SharedValue } from 'react-native-reanimated'; import Animated, { Easing, - SharedValue, interpolate, useAnimatedStyle, useSharedValue, diff --git a/apps/common-app/src/examples/ExtrapolationExample.tsx b/apps/common-app/src/examples/ExtrapolationExample.tsx index 9fd3bb5ac51..c7a786b6b58 100644 --- a/apps/common-app/src/examples/ExtrapolationExample.tsx +++ b/apps/common-app/src/examples/ExtrapolationExample.tsx @@ -8,10 +8,8 @@ import Animated, { withTiming, Extrapolation, } from 'react-native-reanimated'; -import { - PanGestureHandler, - PanGestureHandlerGestureEvent, -} from 'react-native-gesture-handler'; +import type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler'; +import { PanGestureHandler } from 'react-native-gesture-handler'; export default function ExtrapolationExample() { const translation = { diff --git a/apps/common-app/src/examples/FrameCallbackExample.tsx b/apps/common-app/src/examples/FrameCallbackExample.tsx index 1b29469d79c..310fd93fce1 100644 --- a/apps/common-app/src/examples/FrameCallbackExample.tsx +++ b/apps/common-app/src/examples/FrameCallbackExample.tsx @@ -1,5 +1,5 @@ +import type { FrameInfo } from 'react-native-reanimated'; import Animated, { - FrameInfo, useAnimatedStyle, useFrameCallback, useSharedValue, diff --git a/apps/common-app/src/examples/Game2048Example.tsx b/apps/common-app/src/examples/Game2048Example.tsx index d190689aa3e..229cc447f61 100644 --- a/apps/common-app/src/examples/Game2048Example.tsx +++ b/apps/common-app/src/examples/Game2048Example.tsx @@ -1,4 +1,5 @@ -import { Text, StyleSheet, View, ColorValue, Alert } from 'react-native'; +import type { ColorValue } from 'react-native'; +import { Text, StyleSheet, View, Alert } from 'react-native'; import Animated, { LinearTransition, ZoomIn } from 'react-native-reanimated'; import React from 'react'; diff --git a/apps/common-app/src/examples/GestureHandlerExample.tsx b/apps/common-app/src/examples/GestureHandlerExample.tsx index 27569ddcb67..7d0be8eabfb 100644 --- a/apps/common-app/src/examples/GestureHandlerExample.tsx +++ b/apps/common-app/src/examples/GestureHandlerExample.tsx @@ -3,15 +3,17 @@ import Animated, { useSharedValue, withSpring, } from 'react-native-reanimated'; -import { - Gesture, - GestureDetector, - GestureHandlerRootView, +import type { GestureStateManager, GestureTouchEvent, GestureUpdateEvent, PanGestureChangeEventPayload, } from 'react-native-gesture-handler'; +import { + Gesture, + GestureDetector, + GestureHandlerRootView, +} from 'react-native-gesture-handler'; import React from 'react'; import { StyleSheet } from 'react-native'; diff --git a/apps/common-app/src/examples/IPodExample.tsx b/apps/common-app/src/examples/IPodExample.tsx index d60b126b2c0..ad443b06c36 100644 --- a/apps/common-app/src/examples/IPodExample.tsx +++ b/apps/common-app/src/examples/IPodExample.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { View, StyleSheet, Dimensions, Text } from 'react-native'; +import type { SharedValue } from 'react-native-reanimated'; import Animated, { useSharedValue, useAnimatedStyle, @@ -9,12 +10,9 @@ import Animated, { useAnimatedGestureHandler, Extrapolation, interpolate, - SharedValue, } from 'react-native-reanimated'; -import { - PanGestureHandler, - PanGestureHandlerGestureEvent, -} from 'react-native-gesture-handler'; +import type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler'; +import { PanGestureHandler } from 'react-native-gesture-handler'; const data = [ { artist: 'Nirvana', song: 'Smells Like Teen Spirit' }, diff --git a/apps/common-app/src/examples/JSPropsExample.tsx b/apps/common-app/src/examples/JSPropsExample.tsx index af183205def..9e9e76e14dc 100644 --- a/apps/common-app/src/examples/JSPropsExample.tsx +++ b/apps/common-app/src/examples/JSPropsExample.tsx @@ -1,4 +1,5 @@ -import { TextInput, View, StyleSheet, ColorValue } from 'react-native'; +import type { ColorValue } from 'react-native'; +import { TextInput, View, StyleSheet } from 'react-native'; import React from 'react'; import Svg, { Path, Circle, G } from 'react-native-svg'; import Animated, { diff --git a/apps/common-app/src/examples/LayoutAnimations/Carousel.tsx b/apps/common-app/src/examples/LayoutAnimations/Carousel.tsx index e58e0fb75c3..4ccb2130b97 100644 --- a/apps/common-app/src/examples/LayoutAnimations/Carousel.tsx +++ b/apps/common-app/src/examples/LayoutAnimations/Carousel.tsx @@ -1,12 +1,6 @@ import Animated, { SlideInLeft, SlideOutRight } from 'react-native-reanimated'; -import { - Button, - Image, - ImageSourcePropType, - StyleSheet, - Text, - View, -} from 'react-native'; +import type { ImageSourcePropType } from 'react-native'; +import { Button, Image, StyleSheet, Text, View } from 'react-native'; import React, { useState } from 'react'; const AnimatedImage = Animated.createAnimatedComponent(Image); diff --git a/apps/common-app/src/examples/LayoutAnimations/CustomLayout.tsx b/apps/common-app/src/examples/LayoutAnimations/CustomLayout.tsx index cd4654ce97a..3b2bbac3282 100644 --- a/apps/common-app/src/examples/LayoutAnimations/CustomLayout.tsx +++ b/apps/common-app/src/examples/LayoutAnimations/CustomLayout.tsx @@ -1,5 +1,5 @@ +import type { LayoutAnimationFunction } from 'react-native-reanimated'; import Animated, { - LayoutAnimationFunction, makeMutable, withDelay, withSequence, diff --git a/apps/common-app/src/examples/LayoutAnimations/HabitsExample.tsx b/apps/common-app/src/examples/LayoutAnimations/HabitsExample.tsx index b85515c81d7..5ffd72e2a58 100644 --- a/apps/common-app/src/examples/LayoutAnimations/HabitsExample.tsx +++ b/apps/common-app/src/examples/LayoutAnimations/HabitsExample.tsx @@ -1,12 +1,12 @@ import React from 'react'; import { Platform, Pressable, StyleSheet, View, Text } from 'react-native'; +import type { AnimatedProps } from 'react-native-reanimated'; import Animated, { FadeInLeft, FadeInDown, ZoomIn, LightSpeedInLeft, BounceIn, - AnimatedProps, FadeOut, } from 'react-native-reanimated'; import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome'; diff --git a/apps/common-app/src/examples/LayoutAnimations/Modal.tsx b/apps/common-app/src/examples/LayoutAnimations/Modal.tsx index 9db54d0689e..859776f8b49 100644 --- a/apps/common-app/src/examples/LayoutAnimations/Modal.tsx +++ b/apps/common-app/src/examples/LayoutAnimations/Modal.tsx @@ -1,7 +1,9 @@ -import Animated, { +import type { EntryAnimationsValues, EntryExitAnimationFunction, ExitAnimationsValues, +} from 'react-native-reanimated'; +import Animated, { useAnimatedStyle, withTiming, } from 'react-native-reanimated'; diff --git a/apps/common-app/src/examples/LayoutAnimations/ModalNewAPI.tsx b/apps/common-app/src/examples/LayoutAnimations/ModalNewAPI.tsx index 6e1dbb0342c..ccb4f5b97a1 100644 --- a/apps/common-app/src/examples/LayoutAnimations/ModalNewAPI.tsx +++ b/apps/common-app/src/examples/LayoutAnimations/ModalNewAPI.tsx @@ -1,7 +1,9 @@ -import Animated, { +import type { EntryAnimationsValues, EntryExitAnimationFunction, ExitAnimationsValues, +} from 'react-native-reanimated'; +import Animated, { Layout, withDelay, withTiming, diff --git a/apps/common-app/src/examples/LayoutAnimations/NativeModals.tsx b/apps/common-app/src/examples/LayoutAnimations/NativeModals.tsx index ca66266b8eb..3c92240044a 100644 --- a/apps/common-app/src/examples/LayoutAnimations/NativeModals.tsx +++ b/apps/common-app/src/examples/LayoutAnimations/NativeModals.tsx @@ -1,11 +1,9 @@ import { Alert, Modal, Pressable, StyleSheet, Text, View } from 'react-native'; -import { - NativeStackNavigationProp, - createNativeStackNavigator, -} from '@react-navigation/native-stack'; +import type { NativeStackNavigationProp } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import React, { useState } from 'react'; -import { ParamListBase } from '@react-navigation/native'; +import type { ParamListBase } from '@react-navigation/native'; // import { createStackNavigator } from "@react-navigation/stack"; diff --git a/apps/common-app/src/examples/LayoutAnimations/NestedNativeStacksWithLayout.tsx b/apps/common-app/src/examples/LayoutAnimations/NestedNativeStacksWithLayout.tsx index 761d2d0bbd5..c6c034301b4 100644 --- a/apps/common-app/src/examples/LayoutAnimations/NestedNativeStacksWithLayout.tsx +++ b/apps/common-app/src/examples/LayoutAnimations/NestedNativeStacksWithLayout.tsx @@ -2,10 +2,8 @@ import Animated, { SlideOutLeft, SlideOutRight } from 'react-native-reanimated'; import { Button, StyleSheet, View } from 'react-native'; import React from 'react'; -import { - NativeStackScreenProps, - createNativeStackNavigator, -} from '@react-navigation/native-stack'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; type ParamList = { First?: {}; diff --git a/apps/common-app/src/examples/LayoutAnimations/ReactionsCounterExample.tsx b/apps/common-app/src/examples/LayoutAnimations/ReactionsCounterExample.tsx index f55f3939710..720fac3558b 100644 --- a/apps/common-app/src/examples/LayoutAnimations/ReactionsCounterExample.tsx +++ b/apps/common-app/src/examples/LayoutAnimations/ReactionsCounterExample.tsx @@ -1,6 +1,8 @@ -import Animated, { +import type { EntryAnimationsValues, ExitAnimationsValues, +} from 'react-native-reanimated'; +import Animated, { useAnimatedStyle, useSharedValue, withDelay, diff --git a/apps/common-app/src/examples/LayoutAnimations/WaterfallGridExample.tsx b/apps/common-app/src/examples/LayoutAnimations/WaterfallGridExample.tsx index 7c3a0c726a3..16abe622c60 100644 --- a/apps/common-app/src/examples/LayoutAnimations/WaterfallGridExample.tsx +++ b/apps/common-app/src/examples/LayoutAnimations/WaterfallGridExample.tsx @@ -1,5 +1,5 @@ +import type { BaseAnimationBuilder } from 'react-native-reanimated'; import Animated, { - BaseAnimationBuilder, BounceOut, CurvedTransition, FadingTransition, @@ -11,7 +11,8 @@ import Animated, { SequencedTransition, combineTransition, } from 'react-native-reanimated'; -import { Image, LayoutChangeEvent, Text, View, StyleSheet } from 'react-native'; +import type { LayoutChangeEvent } from 'react-native'; +import { Image, Text, View, StyleSheet } from 'react-native'; import React, { useCallback, useEffect, useMemo, useState } from 'react'; import { ScrollView, TapGestureHandler } from 'react-native-gesture-handler'; @@ -120,7 +121,7 @@ export function WaterfallGrid({ key={pok.address} style={[ { - width: width, + width, height: pokHeight, backgroundColor: pok.color, left: cur * width + (cur + 1) * margin, @@ -135,7 +136,7 @@ export function WaterfallGrid({ @@ -148,7 +149,7 @@ export function WaterfallGrid({ {cardsMemo.length === 0 && Loading } {cardsMemo.length !== 0 && ( - {cardsMemo} + {cardsMemo} )} @@ -167,7 +168,7 @@ export default function WaterfallGridExample() { style={styles.picker} itemStyle={{ height: 50 }} onValueChange={(itemValue) => { - setSelectedTransition(itemValue as string); + setSelectedTransition(itemValue); }}> ) { diff --git a/apps/common-app/src/examples/ScrollableViewExample.tsx b/apps/common-app/src/examples/ScrollableViewExample.tsx index 348fd43af0d..4a77363fc32 100644 --- a/apps/common-app/src/examples/ScrollableViewExample.tsx +++ b/apps/common-app/src/examples/ScrollableViewExample.tsx @@ -7,17 +7,10 @@ import Animated, { withTiming, Easing, } from 'react-native-reanimated'; -import { - View, - Dimensions, - Platform, - StyleSheet, - LayoutChangeEvent, -} from 'react-native'; -import { - PanGestureHandler, - PanGestureHandlerGestureEvent, -} from 'react-native-gesture-handler'; +import type { LayoutChangeEvent } from 'react-native'; +import { View, Dimensions, Platform, StyleSheet } from 'react-native'; +import type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler'; +import { PanGestureHandler } from 'react-native-gesture-handler'; import { useHeaderHeight } from '@react-navigation/elements'; const windowDimensions = Dimensions.get('window'); diff --git a/apps/common-app/src/examples/SharedElementTransitions/BorderRadii.tsx b/apps/common-app/src/examples/SharedElementTransitions/BorderRadii.tsx index e74af7333b7..b190bc53646 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/BorderRadii.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/BorderRadii.tsx @@ -1,10 +1,8 @@ import * as React from 'react'; import { View, Button, StyleSheet } from 'react-native'; -import { ParamListBase } from '@react-navigation/native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { ParamListBase } from '@react-navigation/native'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated, { SharedTransition, SharedTransitionType, diff --git a/apps/common-app/src/examples/SharedElementTransitions/Card.tsx b/apps/common-app/src/examples/SharedElementTransitions/Card.tsx index 93a833ae6b6..6465a57051c 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/Card.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/Card.tsx @@ -1,10 +1,10 @@ import * as React from 'react'; import { View, TouchableNativeFeedback, StyleSheet } from 'react-native'; -import { - createNativeStackNavigator, +import type { NativeStackNavigationProp, NativeStackScreenProps, } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated from 'react-native-reanimated'; type ParamList = { @@ -36,7 +36,7 @@ function Card({ }: CardProps) { const goNext = (screenName: keyof ParamList) => { navigation.navigate(screenName, { - title: title, + title, sharedTransitionTag: transitionTag, }); }; diff --git a/apps/common-app/src/examples/SharedElementTransitions/ChangeTheme.tsx b/apps/common-app/src/examples/SharedElementTransitions/ChangeTheme.tsx index 438994bd6f1..dde15a9fa04 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/ChangeTheme.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/ChangeTheme.tsx @@ -14,12 +14,10 @@ import Animated, { withSpring, } from 'react-native-reanimated'; import { Button, StyleSheet, View, Text } from 'react-native'; -import { - NativeStackScreenProps, - createNativeStackNavigator, -} from '@react-navigation/native-stack'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; -import { ParamListBase } from '@react-navigation/native'; +import type { ParamListBase } from '@react-navigation/native'; const Stack = createNativeStackNavigator(); const Context = createContext({ diff --git a/apps/common-app/src/examples/SharedElementTransitions/CustomTransition.tsx b/apps/common-app/src/examples/SharedElementTransitions/CustomTransition.tsx index f43533ab4a0..5b0b07d9d25 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/CustomTransition.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/CustomTransition.tsx @@ -1,10 +1,8 @@ import * as React from 'react'; import { View, Button, StyleSheet } from 'react-native'; -import { ParamListBase } from '@react-navigation/native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { ParamListBase } from '@react-navigation/native'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated, { SharedTransition, withSpring, diff --git a/apps/common-app/src/examples/SharedElementTransitions/DuplicateTags.tsx b/apps/common-app/src/examples/SharedElementTransitions/DuplicateTags.tsx index b7cfecdb673..8c6d1d6afae 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/DuplicateTags.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/DuplicateTags.tsx @@ -1,8 +1,6 @@ -import { ParamListBase } from '@react-navigation/native'; -import { - NativeStackScreenProps, - createNativeStackNavigator, -} from '@react-navigation/native-stack'; +import type { ParamListBase } from '@react-navigation/native'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import * as React from 'react'; import { StyleSheet, TouchableNativeFeedback, View, Text } from 'react-native'; import Animated, { useAnimatedStyle } from 'react-native-reanimated'; diff --git a/apps/common-app/src/examples/SharedElementTransitions/FlatList.tsx b/apps/common-app/src/examples/SharedElementTransitions/FlatList.tsx index d1a860b2407..79dda15018d 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/FlatList.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/FlatList.tsx @@ -1,4 +1,8 @@ import React from 'react'; +import type { + TouchableWithoutFeedbackProps, + ListRenderItemInfo, +} from 'react-native'; import { View, Button, @@ -6,13 +10,9 @@ import { StyleSheet, Text, TouchableOpacity, - TouchableWithoutFeedbackProps, - ListRenderItemInfo, } from 'react-native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated from 'react-native-reanimated'; type Optional = Pick, K> & Omit; diff --git a/apps/common-app/src/examples/SharedElementTransitions/Gallery.tsx b/apps/common-app/src/examples/SharedElementTransitions/Gallery.tsx index aa2d15f668a..a7d3b56f504 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/Gallery.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/Gallery.tsx @@ -1,9 +1,7 @@ import * as React from 'react'; import { View, Text, StyleSheet, Pressable, Dimensions } from 'react-native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated, { FadeIn } from 'react-native-reanimated'; const florence = require('./assets/florence.jpg'); diff --git a/apps/common-app/src/examples/SharedElementTransitions/ImageStack.tsx b/apps/common-app/src/examples/SharedElementTransitions/ImageStack.tsx index 35cae8ba0aa..9fccb9f9c6c 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/ImageStack.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/ImageStack.tsx @@ -1,16 +1,8 @@ import React from 'react'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; -import { - View, - ImageSourcePropType, - Pressable, - ScrollView, - Button, - StyleSheet, -} from 'react-native'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; +import type { ImageSourcePropType } from 'react-native'; +import { View, Pressable, ScrollView, Button, StyleSheet } from 'react-native'; import Animated from 'react-native-reanimated'; const florence = require('./assets/florence.jpg'); diff --git a/apps/common-app/src/examples/SharedElementTransitions/LayoutAnimation.tsx b/apps/common-app/src/examples/SharedElementTransitions/LayoutAnimation.tsx index 871af4d2520..d638a6efaea 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/LayoutAnimation.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/LayoutAnimation.tsx @@ -1,10 +1,8 @@ import * as React from 'react'; import { Button, View, StyleSheet } from 'react-native'; -import { ParamListBase } from '@react-navigation/native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { ParamListBase } from '@react-navigation/native'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated, { SlideInLeft, SlideOutLeft } from 'react-native-reanimated'; const photo = require('./assets/image.jpg'); diff --git a/apps/common-app/src/examples/SharedElementTransitions/ManyScreens.tsx b/apps/common-app/src/examples/SharedElementTransitions/ManyScreens.tsx index 9216412853e..a9a0d14af49 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/ManyScreens.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/ManyScreens.tsx @@ -1,10 +1,8 @@ import * as React from 'react'; import { View, Button, StyleSheet } from 'react-native'; -import { ParamListBase } from '@react-navigation/native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { ParamListBase } from '@react-navigation/native'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated from 'react-native-reanimated'; const Stack = createNativeStackNavigator(); diff --git a/apps/common-app/src/examples/SharedElementTransitions/ManyTags.tsx b/apps/common-app/src/examples/SharedElementTransitions/ManyTags.tsx index 37d336fd9ae..fcd79f0c071 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/ManyTags.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/ManyTags.tsx @@ -1,10 +1,8 @@ import * as React from 'react'; import { Button, View, Text, StyleSheet } from 'react-native'; -import { ParamListBase } from '@react-navigation/native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { ParamListBase } from '@react-navigation/native'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated from 'react-native-reanimated'; const photo = require('./assets/image.jpg'); diff --git a/apps/common-app/src/examples/SharedElementTransitions/Modals.tsx b/apps/common-app/src/examples/SharedElementTransitions/Modals.tsx index d3cd81f3cdc..5b3d8c69b6d 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/Modals.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/Modals.tsx @@ -1,9 +1,7 @@ import * as React from 'react'; import { TouchableNativeFeedback, StyleSheet } from 'react-native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated, { runOnJS, useAnimatedGestureHandler, @@ -11,10 +9,8 @@ import Animated, { useSharedValue, withSpring, } from 'react-native-reanimated'; -import { - PanGestureHandler, - PanGestureHandlerGestureEvent, -} from 'react-native-gesture-handler'; +import type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler'; +import { PanGestureHandler } from 'react-native-gesture-handler'; type ParamList = { Screen1?: object; @@ -41,7 +37,7 @@ function Card({ }: CardProps) { const goNext = (screenName: keyof ParamList) => { navigation.navigate(screenName, { - title: title, + title, sharedTransitionTag: transitionTag, }); }; diff --git a/apps/common-app/src/examples/SharedElementTransitions/NestedRotation.tsx b/apps/common-app/src/examples/SharedElementTransitions/NestedRotation.tsx index c2830cf410f..a67facad6c4 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/NestedRotation.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/NestedRotation.tsx @@ -1,10 +1,8 @@ import * as React from 'react'; import { View, Button, StyleSheet } from 'react-native'; -import { ParamListBase } from '@react-navigation/native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { ParamListBase } from '@react-navigation/native'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated from 'react-native-reanimated'; import { createContext } from 'react'; diff --git a/apps/common-app/src/examples/SharedElementTransitions/NestedStacks.tsx b/apps/common-app/src/examples/SharedElementTransitions/NestedStacks.tsx index 48ff157961e..eab7e203837 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/NestedStacks.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/NestedStacks.tsx @@ -1,10 +1,8 @@ import * as React from 'react'; import { View, Button, StyleSheet } from 'react-native'; -import { ParamListBase } from '@react-navigation/native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { ParamListBase } from '@react-navigation/native'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated from 'react-native-reanimated'; const Stack = createNativeStackNavigator(); diff --git a/apps/common-app/src/examples/SharedElementTransitions/Profiles.tsx b/apps/common-app/src/examples/SharedElementTransitions/Profiles.tsx index 822d3190a28..ab0217adb4e 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/Profiles.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/Profiles.tsx @@ -1,4 +1,5 @@ import * as React from 'react'; +import type { ImageSourcePropType } from 'react-native'; import { View, Text, @@ -9,12 +10,9 @@ import { FlatList, StatusBar, Platform, - ImageSourcePropType, } from 'react-native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated, { FadeIn, runOnJS, diff --git a/apps/common-app/src/examples/SharedElementTransitions/ProgressTransition.tsx b/apps/common-app/src/examples/SharedElementTransitions/ProgressTransition.tsx index d1ecc0aceca..4c4c0ff1b4c 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/ProgressTransition.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/ProgressTransition.tsx @@ -7,10 +7,8 @@ import { Dimensions, StatusBar, } from 'react-native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated, { FadeInDown, FadeInLeft, diff --git a/apps/common-app/src/examples/SharedElementTransitions/ReducedMotionSharedExample.tsx b/apps/common-app/src/examples/SharedElementTransitions/ReducedMotionSharedExample.tsx index 802f686e0a8..97be5950a1b 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/ReducedMotionSharedExample.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/ReducedMotionSharedExample.tsx @@ -6,12 +6,10 @@ import Animated, { withSpring, } from 'react-native-reanimated'; import { Button, StyleSheet, View } from 'react-native'; -import { - NativeStackScreenProps, - createNativeStackNavigator, -} from '@react-navigation/native-stack'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; -import { ParamListBase } from '@react-navigation/native'; +import type { ParamListBase } from '@react-navigation/native'; const Stack = createNativeStackNavigator(); diff --git a/apps/common-app/src/examples/SharedElementTransitions/RestoreState.tsx b/apps/common-app/src/examples/SharedElementTransitions/RestoreState.tsx index 63b955d48bf..c845d1d8b09 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/RestoreState.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/RestoreState.tsx @@ -1,10 +1,8 @@ import * as React from 'react'; import { Button, View, StyleSheet } from 'react-native'; -import { ParamListBase } from '@react-navigation/native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { ParamListBase } from '@react-navigation/native'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated from 'react-native-reanimated'; const Stack = createNativeStackNavigator(); diff --git a/apps/common-app/src/examples/SharedElementTransitions/TransitionRestart.tsx b/apps/common-app/src/examples/SharedElementTransitions/TransitionRestart.tsx index ec8b7b3fed1..f80f6276648 100644 --- a/apps/common-app/src/examples/SharedElementTransitions/TransitionRestart.tsx +++ b/apps/common-app/src/examples/SharedElementTransitions/TransitionRestart.tsx @@ -1,10 +1,9 @@ import * as React from 'react'; -import { View, Button, StyleSheet, StyleProp, ViewStyle } from 'react-native'; -import { ParamListBase } from '@react-navigation/native'; -import { - createNativeStackNavigator, - NativeStackScreenProps, -} from '@react-navigation/native-stack'; +import type { StyleProp, ViewStyle } from 'react-native'; +import { View, Button, StyleSheet } from 'react-native'; +import type { ParamListBase } from '@react-navigation/native'; +import type { NativeStackScreenProps } from '@react-navigation/native-stack'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import Animated, { SharedTransition, SharedTransitionType, diff --git a/apps/common-app/src/examples/SwipeableListExample.tsx b/apps/common-app/src/examples/SwipeableListExample.tsx index 4aecdac3ddf..7f1d63c087e 100644 --- a/apps/common-app/src/examples/SwipeableListExample.tsx +++ b/apps/common-app/src/examples/SwipeableListExample.tsx @@ -9,11 +9,11 @@ import Animated, { Easing, runOnJS, } from 'react-native-reanimated'; +import type { PanGestureHandlerGestureEvent } from 'react-native-gesture-handler'; import { PanGestureHandler, TouchableOpacity, FlatList, - PanGestureHandlerGestureEvent, } from 'react-native-gesture-handler'; const windowDimensions = Dimensions.get('window'); diff --git a/apps/common-app/src/examples/WithClampExample.tsx b/apps/common-app/src/examples/WithClampExample.tsx index b4e618fabf8..3534a4dfc80 100644 --- a/apps/common-app/src/examples/WithClampExample.tsx +++ b/apps/common-app/src/examples/WithClampExample.tsx @@ -4,7 +4,8 @@ import Animated, { withSpring, withClamp, } from 'react-native-reanimated'; -import { View, Text, Button, StyleSheet, ViewStyle } from 'react-native'; +import type { ViewStyle } from 'react-native'; +import { View, Text, Button, StyleSheet } from 'react-native'; import React, { useState } from 'react'; const VIOLET = '#b58df1'; diff --git a/apps/common-app/src/examples/WorkletRuntimeExample.tsx b/apps/common-app/src/examples/WorkletRuntimeExample.tsx index 2f3dad469e3..27b3ea29557 100644 --- a/apps/common-app/src/examples/WorkletRuntimeExample.tsx +++ b/apps/common-app/src/examples/WorkletRuntimeExample.tsx @@ -1,8 +1,8 @@ import React from 'react'; import { Button, StyleSheet, View } from 'react-native'; +import type { WorkletRuntime } from 'react-native-reanimated'; import Animated, { Easing, - WorkletRuntime, createWorkletRuntime, runOnJS, runOnUI,