diff --git a/package.json b/package.json index 4351f884b8f..ebecf043a25 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "@types/babel__generator": "^7.6.4", "@types/babel__traverse": "^7.14.2", "@types/jest": "^27.4.0", - "@types/react-native": "^0.66.15", + "@types/react-native": "^0.69.5", "@typescript-eslint/eslint-plugin": "^5.11.0", "@typescript-eslint/parser": "^5.11.0", "babel-eslint": "^10.1.0", diff --git a/src/reanimated2/component/FlatList.tsx b/src/reanimated2/component/FlatList.tsx index 86a8fa0620f..ba1a27b4cda 100644 --- a/src/reanimated2/component/FlatList.tsx +++ b/src/reanimated2/component/FlatList.tsx @@ -6,10 +6,14 @@ import { ILayoutAnimationBuilder } from '../layoutReanimation/animationBuilder/c const AnimatedFlatList = createAnimatedComponent(FlatList as any) as any; +interface AnimatedFlatListProps { + onLayout: (event: LayoutChangeEvent) => void; + // implicit `children` prop has been removed in @types/react^18.0.0 + children: React.ReactNode; +} + const createCellRenderer = (itemLayoutAnimation?: ILayoutAnimationBuilder) => { - const cellRenderer: React.FC<{ - onLayout: (event: LayoutChangeEvent) => void; - }> = (props) => { + const cellRenderer = (props: AnimatedFlatListProps) => { return ( {props.children} @@ -20,11 +24,11 @@ const createCellRenderer = (itemLayoutAnimation?: ILayoutAnimationBuilder) => { return cellRenderer; }; -export interface ReanimatedFlatlistProps extends FlatListProps { +export interface ReanimatedFlatListProps extends FlatListProps { itemLayoutAnimation?: ILayoutAnimationBuilder; } -type ReanimatedFlatListFC = React.FC>; +type ReanimatedFlatListFC = React.FC>; const ReanimatedFlatlist: ReanimatedFlatListFC = forwardRef( (props: ReanimatedFlatListProps, ref: ForwardedRef) => { diff --git a/yarn.lock b/yarn.lock index 699a0aaa498..e54ef58a159 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3933,12 +3933,12 @@ dependencies: "@types/react" "*" -"@types/react-native@^0.66.15": - version "0.66.21" - resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.66.21.tgz#0af38b44fb5a4afdc4ef6ecf065ef91ee5bc813f" - integrity sha512-O/PLXzTWZsNByotNKLxBWe/ePr/qV2km2pXflnMFkaot3KdfMl36E/0c5JVRMKCxxmDVvoazVHkqPuAvnkkgxA== +"@types/react-native@^0.69.5": + version "0.69.5" + resolved "https://registry.yarnpkg.com/@types/react-native/-/react-native-0.69.5.tgz#7709fdbff031a5ecf1956705e6c4a07cdfe6867c" + integrity sha512-mSUCuGUsW2kJlZiu4GmdYVDKZX/52iyC9rm6dxAmflJj1b7kSO/CMSDy5WbcfS8QerxTqbYGTrIwHD0GnXHzbQ== dependencies: - "@types/react" "^17" + "@types/react" "*" "@types/react-test-renderer@>=16.9.0": version "18.0.0" @@ -3965,15 +3965,6 @@ "@types/scheduler" "*" csstype "^3.0.2" -"@types/react@^17": - version "17.0.48" - resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.48.tgz#a4532a8b91d7b27b8768b6fc0c3bccb760d15a6c" - integrity sha512-zJ6IYlJ8cYYxiJfUaZOQee4lh99mFihBoqkOSEGV+dFi9leROW6+PgstzQ+w3gWTnUfskALtQPGHK6dYmPj+2A== - dependencies: - "@types/prop-types" "*" - "@types/scheduler" "*" - csstype "^3.0.2" - "@types/responselike@*", "@types/responselike@^1.0.0": version "1.0.0" resolved "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz" @@ -9935,7 +9926,7 @@ react-test-renderer@18.0.0: react@17.0.2: version "17.0.2" - resolved "https://registry.npmjs.org/react/-/react-17.0.2.tgz" + resolved "https://registry.yarnpkg.com/react/-/react-17.0.2.tgz#d0b5cc516d29eb3eee383f75b62864cfb6800037" integrity sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA== dependencies: loose-envify "^1.1.0"