web icon indicating copy to clipboard operation
web copied to clipboard

Browser Back Button Not Working as execpted.

Open belt-basya opened this issue 5 years ago • 0 comments

Hi, I am using

"@react-navigation/web": "^1.0.0-alpha.9",
"react": "16.9.0",
"react-native-web": "0.11.7",
"react-navigation": "^4.4.0",
"react-navigation-stack": "^2.8.2",
"react-navigation-tabs": "^2.9.0",

I am facing below problems.

  1. For some screens the browser bak buttons work perfectly.
  2. For some other screen, After pressing the browser back buttons also it will remain on the same screen.
  3. For some other screen, the browser back button should press more than once(2-3) to go back.

This behavior is not constant i.e. it will change randomly from screen to screen.

I have referred this to handle browser back buttons https://www.youtube.com/watch?v=Czih6w57P9A i.e.

import { createBrowserApp } from '@react-navigation/web'
import { createAppContainer } from 'react-navigation'

const Navigator = Platform.OS === 'web' ? createBrowserApp(config, { history: 'hash' }) : createAppContainer(config)

Can you help me out? Thanks.

belt-basya avatar Nov 30 '20 11:11 belt-basya