私はreact-native-modalboxを使用しています。反応ネイティブでモーダルを閉じるには
ScreenAからScreenBを開きたいとします。
ScreenBを開いた後でScreenAを終了します。
誰でも解決方法を知っていますか?
import Modal from 'react-native-modalbox';
import ScreenB from './ScreenB';
class ScreenA extends React.Component {
render() {
return (
<View>
<Modal
ref={"modal1"}
swipeToClose={true}
coverScreen={true}
><ScreenB></ScreenB>
</Modal>
<View>
<TouchableOpacity
onPress={() => this.refs.modal1.open()}>
<Text>Click me</Text>
</TouchableOpacity>
</View>
</View>
);
}
}