diff --git a/README.md b/README.md index 1b2ea981..80941c5c 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ yarn add @react-native-community/hooks - [useInteractionManager](https://github.com/react-native-community/hooks#useinteractionmanager) - [useDeviceOrientation](https://github.com/react-native-community/hooks#usedeviceorientation) - [useLayout](https://github.com/react-native-community/hooks#uselayout) +- [useLayoutAnimation](https://github.com/react-native-community/hooks#uselayoutanimation) ### `useAccessibilityInfo` @@ -173,6 +174,32 @@ console.log('layout: ', layout) ``` +### `useLayoutAnimation` + +```js +import { useLayoutAnimation } from '@react-native-community/hooks' + +const { animateNext } = useLayoutAnimation() + +const removeItem = (id: number) => { + // Animates the row deletion, + // you can also provide the same parameters as with `.configureNext`. + animateNext() + setItems(items.filter((item: Item) => item.id !== id)) +} + +return ( + + {items.map((item: Item) => ( + + {item.name} +