Skip to content
This repository has been archived by the owner on Jun 28, 2019. It is now read-only.

Commit

Permalink
Guard measureLayout, add default props. (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
engvik authored Nov 27, 2017
1 parent a4973c0 commit 8aadf97
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/LazyloadListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ class LazyloadListView extends Component {
...ListView.propTypes,
};

static defaultProps = {
...ListView.defaultProps,
}

refresh() {
this._scrollView.refresh();
}
Expand Down
4 changes: 3 additions & 1 deletion lib/LazyloadView.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ class LazyloadView extends Component {
};

measureLayout = (...args) => {
this._root.measureLayout(...args);
if (this._root) {
this._root.measureLayout(...args);
}
};

setNativeProps = (...args) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-lazyload-deux",
"version": "2.0.2",
"version": "2.0.3",
"description": "Lazyload for React Native",
"license": "MIT",
"main": "./index.js",
Expand Down

0 comments on commit 8aadf97

Please sign in to comment.