question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't call setState (or forceUpdate) on an unmounted component

See original GitHub issue

Hi

I created a FluidNavigator and included it in a DrawerNavigator like so.

const ReceiptsNavigator = FluidNavigator({
  AllReceiptsScene: { screen: AllReceiptsScene },
  ReceiptScene: { screen: ReceiptScene },
});

const screens = {
    Home: {
        screen: HomeNavigator,
    },
    Receipts: {
      screen: ReceiptsNavigator
    },
/*etc*/
}
const RootNavigator = createDrawerNavigator(screens, {
 /*some options*/
})

Everything works well within the FluidNavigator but sometimes when I navigate out of it I get this error

C:\git\HausMart\minibar-client-mobile\node_modules\react-native\Libraries\Core\ExceptionsManager.js:71 Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
    in TransitionItemsView (at FluidTransitioner.js:204)
    in RCTView (at View.js:60)
    in View (at Transitioner.js:169)
    in Transitioner (at FluidTransitioner.js:69)
    in FluidTransitioner (at createFluidNavigator.js:35)
    in FluidNavigationView (at createNavigator.js:57)
    in Navigator (at createNavigationContainer.js:383)
    in NavigationContainer (at SceneView.js:10)

Any ideas? 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Dagurmartcommented, Nov 12, 2018

I see that the PR is closed, has this been added to a release? Because I still get this error.

1reaction
chrfalchcommented, Sep 24, 2018

@Dagurmart A fix should be available in pr #107.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't call setState (or forceUpdate) on an unmounted ...
Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application....
Read more >
Prevent React setState on unmounted Component
Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application....
Read more >
Prevent React setState on unmounted component - Martin Belev
Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application...
Read more >
Can't call setState (or forceUpdate) on an unmounted ... - GitHub
Warning: Can't call setState (or forceUpdate) on an unmounted component. This is a no-op, but it indicates a memory leak in your application....
Read more >
Fixing React's “Called SetState() on an ... - How-To Geek
Seeing called setState() on an unmounted component in your browser console means the callback for an async operation is still running after a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found