Coder Social home page Coder Social logo

Comments (12)

TarikFojnica avatar TarikFojnica commented on August 17, 2024 3

I discovered that if you are using react-navigation and have Stack Navigation nested under Drawer Navigation (my case), the component life cycle will break, and it will never unmount, but new screens will be pushed to the top. This can cause Spinner to show up on screens and components it doesn't belong to. It technically does, because the component never unmounted.

from react-native-loading-spinner-overlay.

tbarsbay avatar tbarsbay commented on August 17, 2024 3

I should add that I was experiencing this issue and was not using react-navigation in my project.

from react-native-loading-spinner-overlay.

crazywako avatar crazywako commented on August 17, 2024

Same here

from react-native-loading-spinner-overlay.

facuacostag avatar facuacostag commented on August 17, 2024

I'm having the same issue, any solutions out there?

from react-native-loading-spinner-overlay.

TarikFojnica avatar TarikFojnica commented on August 17, 2024

Same here.

from react-native-loading-spinner-overlay.

Mbotes avatar Mbotes commented on August 17, 2024

@TarikFojnica this is the same issue i've had with it, I am also using react-navigation.

from react-native-loading-spinner-overlay.

weslley39 avatar weslley39 commented on August 17, 2024

@TarikFojnica this is happening for me too. Any solution ?

from react-native-loading-spinner-overlay.

TarikFojnica avatar TarikFojnica commented on August 17, 2024

@Mbotes @weslley39 Not really a solution because I did not have time to dig deeper into the issue, but you can always go back to use DrawerNavigator only, without nesting StackNavigator. That will solve this specific issue but you will loose the StackNavigator features.

I would be happy to hear a real solution too because this is not a particular react-native-loading-spinner-overlay, but rather a react-navigation issue.

from react-native-loading-spinner-overlay.

TarikFojnica avatar TarikFojnica commented on August 17, 2024

@tbarsbay You can test if your componentWillUnmount function works properly in the component containing the spinner (or the main screen component). If does not, that is where the problem lies and you can track it from there.

I think the origin of the problem is the same. It's just that something else causes it in your case.

from react-native-loading-spinner-overlay.

Dhrupal avatar Dhrupal commented on August 17, 2024

Any solution for it?

from react-native-loading-spinner-overlay.

tosinbot avatar tosinbot commented on August 17, 2024

Use a timeout before navigating to the next screen, for example

if(responseJson.msg === "not user login"){ this.setState({ isLoading: false, showCartModal: false, }) setTimeout(() => { Actions.login({type: 'reset', status: 0}) }, 1000)
that's it!

from react-native-loading-spinner-overlay.

niftylettuce avatar niftylettuce commented on August 17, 2024

I'm documenting recommended implementation approach in the README shortly

from react-native-loading-spinner-overlay.

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.