diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 1caeae4243b..b925cb4234d 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -650,11 +650,12 @@ PODS: - React-Core - RNReactNativeHapticFeedback (1.13.0): - React-Core - - RNReanimated (2.13.0): + - RNReanimated (3.3.0): - DoubleConversion - FBLazyVector - FBReactNativeSpec - glog + - hermes-engine - RCT-Folly - RCTRequired - RCTTypeSafety @@ -664,6 +665,7 @@ PODS: - React-Core/RCTWebSocket - React-CoreModules - React-cxxreact + - React-hermes - React-jsi - React-jsiexecutor - React-jsinspector @@ -1283,7 +1285,7 @@ SPEC CHECKSUMS: RNLocalize: 41026b7c14878f1a1b381bc79f668f1fbf841adb RNPermissions: 124173e975e06dea451f5f6ce18314a404428749 RNReactNativeHapticFeedback: b83bfb4b537bdd78eb4f6ffe63c6884f7b049ead - RNReanimated: f0d66bda3d074c43c72a18f4fd4f4c26687bc1fd + RNReanimated: d814cd5a3abf1d042b11b986ac886ac8485ce420 RNScreens: 218801c16a2782546d30bd2026bb625c0302d70f RNSentry: 0aa1567f66c20390f3834637fc4f73380dcd0774 RNShare: eaee3dd5a06dad397c7d3b14762007035c5de405 diff --git a/package.json b/package.json index 98300b836c1..a8cf4ed3b2c 100644 --- a/package.json +++ b/package.json @@ -190,7 +190,7 @@ "react-native-pager-view": "6.2.0", "react-native-permissions": "3.8.1", "react-native-push-notification": "8.1.1", - "react-native-reanimated": "2.13.0", + "react-native-reanimated": "3.3.0", "react-native-reanimated-zoom": "0.3.3", "react-native-render-html": "6.3.4", "react-native-safe-area-context": "3.4.0", diff --git a/src/app/Scenes/ArtQuiz/ArtQuizArtworks.tsx b/src/app/Scenes/ArtQuiz/ArtQuizArtworks.tsx index d0426715b14..6d5d1abd30e 100644 --- a/src/app/Scenes/ArtQuiz/ArtQuizArtworks.tsx +++ b/src/app/Scenes/ArtQuiz/ArtQuizArtworks.tsx @@ -1,12 +1,4 @@ -import { - Touchable, - Flex, - Text, - useScreenDimensions, - useSpace, - ScreenDimensionsProvider, - Screen, -} from "@artsy/palette-mobile" +import { Touchable, Flex, Text, useScreenDimensions, useSpace, Screen } from "@artsy/palette-mobile" import { ArtQuizArtworksDislikeMutation } from "__generated__/ArtQuizArtworksDislikeMutation.graphql" import { ArtQuizArtworksQuery } from "__generated__/ArtQuizArtworksQuery.graphql" import { ArtQuizArtworksSaveMutation } from "__generated__/ArtQuizArtworksSaveMutation.graphql" @@ -196,9 +188,7 @@ const ArtQuizArtworksScreen = () => { export const ArtQuizArtworks = () => { return ( }> - - - + ) } diff --git a/src/app/Scenes/MyCollection/Components/MyCollectionSearchBar.tsx b/src/app/Scenes/MyCollection/Components/MyCollectionSearchBar.tsx index 8a97cbc35fb..4cdf3278910 100644 --- a/src/app/Scenes/MyCollection/Components/MyCollectionSearchBar.tsx +++ b/src/app/Scenes/MyCollection/Components/MyCollectionSearchBar.tsx @@ -3,6 +3,7 @@ import { GridViewIcon } from "app/Components/Icons/GridViewIcon" import { ListViewIcon } from "app/Components/Icons/ListViewIcon" import SearchIcon from "app/Components/Icons/SearchIcon" import { Input } from "app/Components/Input" +import { useAnimatedValue } from "app/Scenes/Artwork/Components/ImageCarousel/useAnimatedValue" import { ViewOption } from "app/Scenes/Search/UserPrefsModel" import { GlobalStore } from "app/store/GlobalStore" import { useFeatureFlag } from "app/utils/hooks/useFeatureFlag" @@ -16,8 +17,6 @@ import { TouchableOpacity, TouchableWithoutFeedback, } from "react-native" -import Animated from "react-native-reanimated" - export interface MyCollectionSearchBarProps { onChangeText: ((text: string) => void) | undefined onFocus?: (e: NativeSyntheticEvent) => void @@ -74,7 +73,7 @@ export const MyCollectionSearchBar: React.FC = ({ onChangeText={setValue} onFocus={onFocus} onBlur={() => { - hasRunFocusedAnimation.setValue(new Animated.Value(0)) + hasRunFocusedAnimation.setValue(0) onIsFocused?.(false) setIsFocused(false) }} @@ -90,7 +89,7 @@ export const MyCollectionSearchBar: React.FC = ({ testID="MyCollectionSearchBarInputCancelButton" onPress={() => { setValue("") - hasRunFocusedAnimation.setValue(new Animated.Value(0)) + hasRunFocusedAnimation.setValue(0) LayoutAnimation.configureNext({ ...LayoutAnimation.Presets.easeInEaseOut, @@ -114,7 +113,7 @@ export const MyCollectionSearchBar: React.FC = ({ { - hasRunFocusedAnimation.setValue(new Animated.Value(0)) + hasRunFocusedAnimation.setValue(0) setIsFocused(true) onIsFocused?.(true) @@ -202,9 +201,3 @@ export const ViewAsIcons: React.FC<{ ) } - -export function useAnimatedValue(init: number) { - return useMemo(() => { - return new Animated.Value(init) - }, []) -} diff --git a/src/setupJest.tsx b/src/setupJest.tsx index 06b0b1aa85b..4f782dbf1fa 100644 --- a/src/setupJest.tsx +++ b/src/setupJest.tsx @@ -17,7 +17,8 @@ import { NativeModules } from "react-native" import mockSafeAreaContext from "react-native-safe-area-context/jest/mock" import track, { useTracking } from "react-tracking" import diff from "snapshot-diff" - +// 👇 needed after upgrading to reanimated 3 otherwise tests break +require("setimmediate") /** * General Preparation */ diff --git a/yarn.lock b/yarn.lock index 1c7f3084312..81e79228f02 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5142,11 +5142,6 @@ resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== -"@types/invariant@^2.2.35": - version "2.2.35" - resolved "https://registry.yarnpkg.com/@types/invariant/-/invariant-2.2.35.tgz#cd3ebf581a6557452735688d8daba6cf0bd5a3be" - integrity sha512-DxX1V9P8zdJPYQat1gHyY0xj3efl8gnMVjiM9iCY6y27lj+PoQWkgjt8jDqmovPqULkKVpKRg8J36iQiA+EtEg== - "@types/is-function@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/is-function/-/is-function-1.0.0.tgz#1b0b819b1636c7baf0d6785d030d12edf70c3e83" @@ -12119,11 +12114,6 @@ lodash.includes@^4.3.0: resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f" integrity sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w== -lodash.isequal@^4.5.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0" - integrity sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ== - lodash.isnumber@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc" @@ -14476,7 +14466,7 @@ react-native-collapsible-tab-view@^6.1.4: react-native-credit-card-input@0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/react-native-credit-card-input/-/react-native-credit-card-input-0.4.1.tgz#e62dd1a9beeab6787e5373ba23b93831cbf5f3de" - integrity sha1-5i3Rqb7qtnh+U3O6I7k4Mcv1894= + integrity sha512-4+AZLLD5Z7ZTBnbH2aQFSXE2O8bypJu7Fi9EnKvZvSASRgwIkViueswh/Lp5LRi+i/TlXqWEERo+qnTTVntCjg== dependencies: card-validator "^3.0.0" lodash.compact "^3.0.1" @@ -14624,18 +14614,15 @@ react-native-reanimated-zoom@0.3.3: resolved "https://registry.yarnpkg.com/react-native-reanimated-zoom/-/react-native-reanimated-zoom-0.3.3.tgz#99161310c398b2d4220e75ce1d9b76eb075bf3f6" integrity sha512-naeMV19218OsVOAw7jq45mZGxcSgvcn5xAJlXep27R0IBo/fqpLlLuXKK2nyCXyLzuIPwgqS3O+LUMcTd2L5Gg== -react-native-reanimated@2.13.0: - version "2.13.0" - resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-2.13.0.tgz#d64c1386626822d4dc22094b4efe028ff2c49cc9" - integrity sha512-yUHyYVIegWWIza4+nVyS3CSmI/Mc8kLFVHw2c6gnSHaYhYA4LeEjH/jBkoMzHk9Xd0Ra3cwtjYKAMG8OTp6JVg== +react-native-reanimated@3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-3.3.0.tgz#80f9d58e28fddf62fe4c1bc792337b8ab57936ab" + integrity sha512-LzfpPZ1qXBGy5BcUHqw3pBC0qSd22qXS3t8hWSbozXNrBkzMhhOrcILE/nEg/PHpNNp1xvGOW8NwpAMF006roQ== dependencies: "@babel/plugin-transform-object-assign" "^7.16.7" "@babel/preset-typescript" "^7.16.7" - "@types/invariant" "^2.2.35" + convert-source-map "^2.0.0" invariant "^2.2.4" - lodash.isequal "^4.5.0" - setimmediate "^1.0.5" - string-hash-64 "^1.0.3" react-native-render-html@6.3.4: version "6.3.4" @@ -16136,11 +16123,6 @@ string-argv@^0.3.1: resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da" integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg== -string-hash-64@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/string-hash-64/-/string-hash-64-1.0.3.tgz#0deb56df58678640db5c479ccbbb597aaa0de322" - integrity sha512-D5OKWKvDhyVWWn2x5Y9b+37NUllks34q1dCDhk/vYcso9fmhs+Tl3KR/gE4v5UNj2UA35cnX4KdVVGkG1deKqw== - string-length@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.1.tgz#4a973bf31ef77c4edbceadd6af2611996985f8a1"