react-navigation / web

Tools for react-navigation on web browsers and servers
https://reactnavigation.org
MIT License
94 stars 28 forks source link

Browser Back Button Not Working as execpted. #55

Open belt-basya opened 4 years ago

belt-basya commented 4 years ago

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.