Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose layouts array #7

Open
wants to merge 3 commits into
base: expose-scroll-ref
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 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 package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"devDependencies": {
"@types/lodash.debounce": "4.0.3",
"@types/prop-types": "15.5.2",
"@types/react-native": "0.49.5",
"@types/react": "16.4.7",
"@types/react-native": "0.49.5",
"@types/resize-observer-browser": "0.1.7",
"file-directives": "1.4.6",
"tslint": "5.11.0",
Expand Down
5 changes: 5 additions & 0 deletions src/core/RecyclerListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,11 @@ export default class RecyclerListView<P extends RecyclerListViewProps, S extends
return layoutManager ? layoutManager.getLayouts()[index] : undefined;
}

public getLayouts(): Layout[] | null {
const layoutManager = this._virtualRenderer.getLayoutManager();
return layoutManager ? layoutManager.getLayouts() : null;
}

public scrollToTop(animate?: boolean): void {
this.scrollToOffset(0, 0, animate);
}
Expand Down