react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

In react native debugger-ui, when reloading the APP, sometimes the screen will be loaded twice

Open lyswhut opened this issue 4 years ago • 2 comments

🐛 Bug Report

In react native debugger-ui, when reloading the APP, sometimes the screen will be loaded twice (the first time is executed before the registerAppLaunchedListener event is issued)

Have you read the Contributing Guidelines on issues?

Yes it is

To Reproduce

  1. Bash run:
react-native init test --version 0.63.4
cd test
yarn add react-native-navigation
npx rnn-link
  1. Update index.js file
import {Navigation} from "react-native-navigation";
import App from "./App";
Navigation.registerComponent('com.myApp.WelcomeScreen', () => App);
Navigation.events().registerAppLaunchedListener(() => {
  console.log('registerAppLaunchedListener')
  Navigation.setRoot({
     root: {
       stack: {
         children: [
           {
             component: {
               name:'com.myApp.WelcomeScreen'
             }
           }
         ]
       }
     }
  });
});
  1. Run npm run android
  2. Open the developer menu and select "Debug", which will automatically open the browser and open react native debugger-ui in the browser
  3. Open the developer tools of the browser, and then click the "reload" button on the page, try "reload" several times to see the problem

Expected behavior

Click the "reload" button to load the page only once

Actual Behavior

Sometimes the reload page is loaded twice (The first time is loaded before the registerAppLaunchedListener event is launched, and the other time is loaded after the registerAppLaunchedListener event is launched) image

Your Environment

  • React Native Navigation version: 7.11.3
  • React Native version: 0.63.4
  • Platform(s) (iOS, Android, or both?): Android (not tested on other platforms)
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator (Android 7.1.4) and Device (Android 10), Debug mode

Reproducible Demo

Since the steps to reproduce this problem are relatively simple, I have not created a repo now, but if you really need it, I can create it later

lyswhut avatar Mar 27 '21 09:03 lyswhut

I am facing the problem now, it drive me crazy

boyuanjiang0-0 avatar Dec 09 '22 04:12 boyuanjiang0-0

Issue is still occurring in latest version of react-native and react-native-navigation as of this comment.

karimb11 avatar Dec 16 '23 22:12 karimb11