Component "{Component}" is preparing but preparation has not completed
Explanation
A call has been made to prepareComponent
for {Component} with the following init props:
{initPropsObject}
However, react has started rendering before the Promise returned from prepareComponent
had resolved.
Possible solution
You have likely called prepareComponent
from another init action without using the returned promise. For example:
// MyPage.jsx
export default withInitAction(
(props, dispatch) => {
dispatch(prepareComponent({Component})); // <== return value unused
return dispatch(prepareComponent(SomeOtherComponent));
},
)(MyPage);
To wait until multiple calls to prepareComponent
have completed, use Promise.all()
:
// MyPage.jsx
export default withInitAction(
(props, dispatch) => {
return Promise.all([
dispatch(prepareComponent({Component})),
dispatch(prepareComponent(SomeOtherComponent))
]);
},
)(MyPage);
A call has been made to prepareComponent
for the component you are trying to render. However, react has started rendering before the Promise returned from prepareComponent
had resolved.
Possible solution
You have likely called prepareComponent
from another init action without using the returned promise. For example:
// MyPage.jsx
export default withInitAction(
(props, dispatch) => {
dispatch(prepareComponent(MyComponent)); // <== return value unused
return dispatch(prepareComponent(SomeOtherComponent));
},
)(MyPage);
To wait until multiple calls to prepareComponent
have completed, use Promise.all()
:
// MyPage.jsx
export default withInitAction(
(props, dispatch) => {
return Promise.all([
dispatch(prepareComponent(MyComponent)),
dispatch(prepareComponent(SomeOtherComponent))
]);
},
)(MyPage);