Skip to content

Commit

Permalink
Add proxy interface for Animated.FlatList to enable passing itemLayou…
Browse files Browse the repository at this point in the history
…tAnimation prop (#4074)

## Summary

Fixed
[#4056](#4056)
by adding proxy interface to the inheritance chain. Also changing
`itemLayoutAnimation` to be optional, since it is optional in source
files.

## Test plan

build & run `InvertedFlatList` in `Example` app
run `yarn jest`
  • Loading branch information
tjzel authored Feb 20, 2023
1 parent cf447d8 commit 4e3da1d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions react-native-reanimated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,12 @@ declare module 'react-native-reanimated' {
export interface ScrollView extends ReactNativeScrollView {}

export class Code extends Component<CodeProps> {}
export class FlatList<T> extends Component<AnimateProps<FlatListProps<T>>> {
itemLayoutAnimation: ILayoutAnimationBuilder;
export interface FlatListPropsWithLayout<T> extends FlatListProps<T> {
itemLayoutAnimation?: ILayoutAnimationBuilder;
}
export class FlatList<T> extends Component<
AnimateProps<FlatListPropsWithLayout<T>>
> {
getNode(): ReactNativeFlatList;
}
// eslint-disable-next-line @typescript-eslint/no-empty-interface
Expand Down

0 comments on commit 4e3da1d

Please sign in to comment.