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) });
}, []);