Giter Club home page Giter Club logo

Comments (2)

cipolleschi avatar cipolleschi commented on August 21, 2024

Hi @birdofpreyru, thanks for the issue.

I feel this is a bug/undocumented behavior. My hypothesis is that when you put the app in background, the Component tree is unmounted so the command is not sent, but stored in some kind of queues. As soon as the app comes back to foreground, the component is remounted, the queue flushed and the command executed.

If that the case, it should be easy to create a simple reproducer using this template, where you can add react-native-webview as a dependency. This would help us investigate whether this is the case.
I don't have a clean and quick solution for this problem, it might require us some architectural discussion, but it is definitely something we want to understand and we want to get to the bottom of this!

from react-native.

birdofpreyru avatar birdofpreyru commented on August 21, 2024

Sure @cipolleschi , here you are: https://github.com/birdofpreyru/issue-45017

After doing yarn, you probably want to open its android project in Android studio, locate react-native-webview/kotlin+java/com.reactnativecommunity.webview/RNCWebViewManagerImpl.kt, and set a breakpoint at the line number 314 (it reads "stopLoading" -> webView.stopLoading()).

Then run the app from Android studio in debug mode (and with dev server running):

  • It opens, loads RN website.
  • You hit the home screen button of emulator (or device)
  • The app goes into background, an (NOBRIDGE) LOG Entering background! is printed in the dev server console, the breakpoint in native code is not hit.
  • Now you press the app icon in emulator to bring it back to the foreground — now the breakpoint for stopLoading() is hit.

from react-native.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.