react-native-modals
react-native-modals copied to clipboard
returning null in conditional rendering does not hide previously rendered dialog
I'm showing dialogs for difference messages in a message handler component.
class MessageHandler extends Component {
...
render() {
switch(this.props.message) {
case A:
return getDialogA();
case B:
return getDialogB();
default:
return null;
}
}
Several issues arise in the following scenario:
- set message to A -> dialog A pops up
- set message to sth other than covered cases -> dialog A DOES NOT disappear
- set message to B -> dialog B pops up BUT on top of the last dialog(dialog A)
- when I hide dialog B by pressing a button, dialog box is gone but overlay of the last dialog is still there.
I think the cause is that rendering null does not hide previously rendered dialog. though I checked that dialog A is unmounted on rendering null.
Is this expected or erratic?
same issue here - any workaround?