Skip to content
This repository was archived by the owner on Mar 27, 2018. It is now read-only.

Commit 134b3b3

Browse files
author
Ian Wensink
committed
fix(drupal-page): stop render when loading data
1 parent 136391a commit 134b3b3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/components/DrupalPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ class DrupalPage extends Component {
113113
// Mark this component as not-ready. This unmounts the Layout and old ContentType.
114114
// Only render if the component is ready.
115115
if (
116-
this.entity &&
117116
!this.props.renderWhileLoadingData &&
118-
!this.entity.isReady()
117+
this.entity &&
118+
!(this.entity.isReady() && !this.state.loadingData)
119119
) {
120120
return null;
121121
}

src/components/EntityMapper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ class EntityMapper extends Component {
7777

7878
this.state = {
7979
entityProps: props.entityProps,
80-
ready: false,
8180
mapper: EntityMapper.getMapperFromProps(props),
81+
ready: false,
8282
uuid: props.uuid,
8383
};
8484
}
@@ -173,10 +173,10 @@ class EntityMapper extends Component {
173173

174174
const newState = {
175175
...this.state,
176-
uuid,
177-
ready: true,
178176
entityProps,
179177
mapper,
178+
ready: true,
179+
uuid,
180180
};
181181

182182
this.setState(newState);

0 commit comments

Comments
 (0)