I am New to React Native. And I have created a screen for example
- A screen
Now inside drawer I have two screen
- D1 screen
- D2 screen
Now when I Move from D1 screen to D2. and then I want to Go back To D1 screen By tapping Default Back Button Of react native I am Directly Going To "A" screen. So means I want To go back to Previous Drawer Screen. please if possible help me. thanks.
here is my code of D2 screen
import React, {useRef} from 'react';
import {View,TouchableOpacity,Image, StyleSheet} from 'react-native';
import Signature from 'react-native-signature-canvas';
import { Card, Badge, Button, Block, Text } from "../components";
import { theme, mocks } from "../constants";
import { createStackNavigator, HeaderBackButton } from "react-navigation-stack";
const DigSign = () => {
const ref = useRef();
const handleSignature = (signature) => {
console.log(signature);
};
const handleEmpty = () => {
console.log('Empty');
};
const handleClear = () => {
console.log('clear success!');
};
const handleEnd = () => {
ref.current.readSignature();
};
return (
<View style={{flex: 1}}>
<Signature
ref={ref}
onEnd={handleEnd}
onOK={handleSignature}
onEmpty={handleEmpty}
onClear={handleClear}
descriptionText={'Sign here!'}
/>
</View>
);
};
export default DigSign;
question from:
https://stackoverflow.com/questions/65949425/how-to-go-back-to-previous-drawer-screen-in-react-native 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…