ignite icon indicating copy to clipboard operation
ignite copied to clipboard

Brand new app - Can't perform a React state update on an unmounted component

Open jamonholmgren opened this issue 2 years ago • 2 comments

Discussed in https://github.com/infinitered/ignite/discussions/1941

Originally posted by papadi May 12, 2022 When I'm creating a new app (npx ignite-cli new MyTestApp --expo) and run it on the browser without any modification of my own (yarn web) then I get this error in my browser console.

"Warning: Can't perform a React state update 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 a useEffect cleanup function."

Any idea why? I cannot detect where it's coming from.

jamonholmgren avatar May 13 '22 16:05 jamonholmgren

So, the issue is that the component is unmounted, but then it tries to do this restore.

https://github.com/infinitered/ignite/blob/a2a075f15358e52b335e42b450295410d888533a/boilerplate/app/navigators/navigation-utilities.tsx#L122

We need to detect that the component has unmounted and prevent trying to update the component.

jamonholmgren avatar May 13 '22 16:05 jamonholmgren

@papadi FYI ^^

jamonholmgren avatar May 13 '22 16:05 jamonholmgren

:tada: This issue has been resolved in version 7.15.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

infinitered-circleci avatar Sep 26 '22 18:09 infinitered-circleci

:tada: This issue has been resolved in version 8.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

infinitered-circleci avatar Sep 26 '22 19:09 infinitered-circleci