popstate - need to click twice on back button to actually get back on react-native

192 Views Asked by At

working on single page appliction trying use popstate to navigate back to previous page but I have to click twice to take me back. I want to make it happen for one click. console showing for each click but needs twice click to navigate back. using react native.

also using props.navigator.push for single page application

 useEffect(() => {
    window.addEventListener('popstate', (event) => { console.log( event) });
  }, []);
0

There are 0 best solutions below