Commit 69cb402f authored by guowenfh's avatar guowenfh Committed by 陈帅

fix Authorized Promise render recreating (#987)

* fix Authorized Promise render

* fix style Authorized blank line
parent f6516602
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment