Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/PROPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ To find the path to each of the function it will depend what content renderer (S
On latest `react-native`, it should:

- For the ScrollView: `contentRef.getScrollResponder().scrollTo(...)` or `contentRef.getScrollResponder().scrollToIndex(...)`, etc...
- For the FlatList: `contentRef.current.getNode().scrollToOffset({ animated: true, offset: 0 });`, etc...
- For the FlatList: `contentRef.current.scrollToOffset({ animated: true, offset: 0 });`, etc...
- For the SectionList: `contentRef.current.getNode().scrollToLocation(...)`, etc...

On older version of react-native, most likely something like `contentRef.getNode().getScrollResponder().scrollTo(...)` for the ScrollView and following the same pattern for the FlatList and SectionList.
Expand Down
6 changes: 1 addition & 5 deletions examples/expo/src/components/modals/FlatList.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ export const FlatList = forwardRef((_, ref) => {

const handleScrollToTop = () => {
if (contentRef.current) {
// Old version of react-native, we need to use getNode()
contentRef.current.getNode().getScrollResponder().scrollTo({
y: 0,
animated: true,
});
contentRef.current.scrollToOffset({ animated: true, offset: 0 });
}
};

Expand Down