diff --git a/src/components/Authorized/PromiseRender.js b/src/components/Authorized/PromiseRender.js index 22f1fcb720af8bf4e3f3c769b9c9bf5a46945958..43a4fa9ebda499a44ff20d6f05392ec3d49761fc 100644 --- a/src/components/Authorized/PromiseRender.js +++ b/src/components/Authorized/PromiseRender.js @@ -6,9 +6,17 @@ export default class PromiseRender extends React.PureComponent { component: null, }; componentDidMount() { - const ok = this.checkIsInstantiation(this.props.ok); - const error = this.checkIsInstantiation(this.props.error); - this.props.promise + this.setRenderComponent(this.props); + } + componentWillReceiveProps(nextProps) { + // new Props enter + this.setRenderComponent(nextProps); + } + // set render Component : ok or error + setRenderComponent(props) { + const ok = this.checkIsInstantiation(props.ok); + const error = this.checkIsInstantiation(props.error); + props.promise .then(() => { this.setState({ component: ok,