You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to re-render a page after a change is emitted to listen. RootElement is getting the changes from the emitter, and the callback in componentDidMount is called with the correct childProps. this.props is set to use the new childProps correctly when we set it using _.assign. However, once we call this.forceUpdate(), the props are reset to what they were before the change. Since this happens with every update, the page is not responsive on the client-side. Here is the code for reference.
this.props.subscribe(childProps => {
...
// Okay, now we've complained about it
// sufficiently, let's go ahead and update.
this.props = _.assign({}, this.props, {childProps});
this.forceUpdate();
});
I am using React 15.4.1
The text was updated successfully, but these errors were encountered:
I am trying to re-render a page after a change is emitted to
listen
.RootElement
is getting the changes from the emitter, and the callback incomponentDidMount
is called with the correctchildProps
.this.props
is set to use the newchildProps
correctly when we set it using_.assign
. However, once we callthis.forceUpdate()
, the props are reset to what they were before the change. Since this happens with every update, the page is not responsive on the client-side. Here is the code for reference.I am using React 15.4.1
The text was updated successfully, but these errors were encountered: