1

I have a parent FlatList which, in its footer, can render another flatlist or a simple scroll view.

const renderFooter1 = () => {
   return <ScrollView> ... </ScrollView>;
}

const renderFooter2 = () => {
   return <FlatList ... />;
}

// Note: I am not doing this in real life, just an example for handling both possible footers
return (
   <FlatList 
      refreshControl={renderRefreshControl()}
      ListHeaderComponent={renderHeader()}
      ListFooterComponent={Math.random() * 10 > 0.5 ? renderFooter1() : renderFooter2()}
      showsVerticalScrollIndicator={false}
   />
);

The problem I am experiencing is that, sometimes, when scrolling down, the component which scrolls is the footer, and not the parent list.

How can I avoid that behavior?

1 Answer 1

1

You can add the prop scrollEnabled={false} to whichever FlatList you don't want to scroll.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.