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
Is a prompt unmounted when "visible" parameter is set to false?
if for sure NO
Ignore this issue and close it
If so or maybe
when you setState for the "visible" parameter ("promptVisible") it will cause a: Warning: Can only update a mounted or mounting component
This setState Warning will happen after opened "promptVisible" to true and you have closed "promptVisible" to false
Example Code:
<Prompt
title="Enter Amount"
placeholder=""
/*defaultValue={this.state.amount}*/
visible={ this.state.promptVisible } //this is where the warning will happen
onCancel={ () => this.closePrompt() } //this method contains, console.warn() and this.setState
onSubmit={
(value) => this.submitAmount(value) //this method contains, console.warn and this.setState
} />
Note: submitAmount method setState for state.amount and state.promptVisible
It will check this.state.promptVisible
or check for a change in value
when the prompt is unmounted!
causing the warning.
After major testing and checking all of my other components for setState and state for unmounted and mounted component I drew the conclusion to this react-native-prompts as it's the only component not displayed when "visible" is false.
The text was updated successfully, but these errors were encountered:
First:
Is a prompt unmounted when "visible" parameter is set to false?
if for sure NO
Ignore this issue and close it
If so or maybe
when you setState for the "visible" parameter ("promptVisible") it will cause a:
Warning: Can only update a mounted or mounting component
This setState Warning will happen after opened "promptVisible" to true and you have closed "promptVisible" to false
Example Code:
Note: submitAmount method setState for state.amount and state.promptVisible
or check for a change in value
causing the warning.
After major testing and checking all of my other components for setState and state for unmounted and mounted component I drew the conclusion to this react-native-prompts as it's the only component not displayed when "visible" is false.
The text was updated successfully, but these errors were encountered: