I'm developing a chat application that use inverted FlashList
to render messages and I want to animate the layout once a new message is sent, but I'm having some problems.
Once I add a new message to the list, when user press on button "Send" I want to add a new message and perform a layout animation, here's a snippet of the button callback:
setMessages([{ content: message }, ...messages]);
listRef.current?.prepareForLayoutAnimationRender();
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);