Skip to content

Commit

Permalink
fix: fix loading element for first mount #340 (#342)
Browse files Browse the repository at this point in the history
* fix: fix loading element for first mount #340

* test: test travis' node version
  • Loading branch information
daybrush committed Jun 12, 2020
1 parent 2d6c7d2 commit 9f6ac1a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- "6"
- "10"
dist: trusty
sudo: false
install:
Expand Down
2 changes: 1 addition & 1 deletion packages/react-infinitegrid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@egjs/react-infinitegrid",
"version": "3.0.4",
"version": "3.0.5",
"description": "A react component that can easily use egjs-infinitegrid",
"types": "declaration/index.d.ts",
"main": "dist/infinitegrid.cjs.js",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ export default class InfiniteGrid<T extends ILayout = GridLayout> extends React.
state.layout = result === "relayout" ? result : state.layout || result;

visibleChildren = ig.getRenderingItems().map((item: IItem) => item.jsx);

if (this.props.loading) {
visibleChildren.push(<LoadingBar key="loadingBar" loading={this.props.loading!} />);
}
} else {
const groups = categorize(items);
if (props.status) {
Expand All @@ -90,6 +86,9 @@ export default class InfiniteGrid<T extends ILayout = GridLayout> extends React.
visibleChildren = groups[0].items.map((item: IItem) => item.jsx);
}
}
if (this.props.loading) {
visibleChildren.push(<LoadingBar key="loadingBar" loading={this.props.loading!} />);
}
return <Tag {...attributes}>{this.renderContainer(visibleChildren)}</Tag>;
}
public componentDidUpdate() {
Expand Down

0 comments on commit 9f6ac1a

Please sign in to comment.