79378757

Date: 2025-01-22 17:52:48
Score: 1
Natty:
Report link

I never see a proper modern answer for this question. In React native simply put

const scrollRef = useRef(null as FlatList<item> | null);

(replace 'item' with the type of item you are using for your array data)

Then in flatlist put:

        ref={(ref) => {
            scrollRef.current = ref;
        }}

After that it is simple to use a ref:

scrollref?.current?.scrollToEnd(); //for example
Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Stu