Cannot update during an existing state transition
See original GitHub issueI’m getting a console error whenever I switch pages.
the json is nothing special:
{
"pages": [{
"name": "page1",
"elements": [{
"type": "text",
"name": "question1"
}, {
"type": "checkbox",
"name": "question2",
"choices": ["item1", "item2", "item3"]
}, {
"type": "radiogroup",
"name": "question3",
"choices": ["item1", "item2", "item3"]
}]
}, {
"name": "page1",
"elements": [{
"type": "text",
"name": "question1"
}, {
"type": "checkbox",
"name": "question2",
"choices": ["item1", "item2", "item3"]
}, {
"type": "radiogroup",
"name": "question3",
"choices": ["item1", "item2", "item3"]
}]
}]
}
and I have the Survey object inside a render function:
render(){
return(
<Card>
<CardContent>
<Survey.Survey
json={this.props.surveyJson}
onComplete={this.props.onSubmit} />
</CardContent>
</Card>
);
}
I’m also using react-redux
any ideas?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (4 by maintainers)
Top Results From Across the Web
Warning: setState(...): Cannot update during an existing state ...
Cannot update during an existing state transition (such as within `render` or another component's constructor). Render methods should be a pure function of ......
Read more >Diagnosing React's "Cannot update during an existing state ...
The problem comes when trying to inject this initial value into a component that is managing its own state for an input's value....
Read more >setState(...): Cannot update during an existing state transition ...
I have a react component which is basically a form that submits a company's data. Everything is okay till I fill the form...
Read more >react_bad_update_state - Rule | DeepScan
Updating the state inside the specific lifecycle methods of a React ... Cannot update during an existing state transition (such as within ...
Read more >setState(…): Cannot update during an existing state transition ...
to a version where the bind is within the constructor. The reason for that is that bind in the render view will give...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @dmitrykurmanov,
just confirming that your fix in https://github.com/surveyjs/surveyjs/commit/67fe99f151d2a2608e70b9101d10cbf401534afa works.
Thank you,
@dmitrykurmanov thanks for what you did, and your support.
About that :
I’m for the moment a beginner with react, I have not enough experience to do that, unfortunately. I will talk about that to my coworker, maybe he will be able to help you.
Again, thanks for everything