-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setstate needs to test if it's mounted before running #26
Comments
I think this problem is automatically eliminated with synchronous unsubscribe from store via willUnmount hook, what we currently do now. |
Something in the timing must be a little bit off then. I'm getting the setState error when I use it like so: https://www.useloom.com/share/71f0474ebfd44a779cf0f3d4c9f44cf1 |
It's in the case where I have a |
<Droppable>
{
({isOver, events, isDragging, type}) => (
<div className={(isOver ? "section is-over " : "section ") + (selected ? "active" : " ")} {...events}>
{
selected && !isFirst ?
<button className="reorder up" onClick={this.moveUp} ><span className="icon icon-caret-up"></span></button>
: null
}
<h4 onClick={this.selectSection}>
{title !== "" ? title : " "}
</h4>
{
description ?
<ReactMarkdown className="description" source={description} />
:
null
}
{children}
{
isDragging && type === 'field' ?
<div className="drag-mask">
<Droppable accepts='field' onDrop={this.fieldDropped}>
{
({events}) => (
<div className="field-drop" {...events}>
Drop field here to add
</div>
)
}
</Droppable>
</div>
:
null
}
<div className="bottom-divider"></div>
{
selected && !isLast ?
<button className="reorder down" onClick={this.moveDown}><span className="icon icon-caret-down"></span></button>
: null
}
</div>
)
}
</Droppable> |
Currently the components don't test if they're mounted before firing a setState. This leads to an occasional case where components throw React's setState error. Each component should internally track their mounted state as described here
The text was updated successfully, but these errors were encountered: