Recoil: Memory leak when using atomFamily/selectorFamily

Created on 19 Jun 2020  路  4Comments  路  Source: facebookexperimental/Recoil

Hello there,

The resources created by atomFamily and selectorFamily are not being properly freed when the specific key changes or if the component using the related RecoilState<T> unmounts.

Since I believe that memory management isn't properly implemented yet, both utils should be marked as _UNSAFE.

https://codesandbox.io/s/cranky-booth-penix?file=/src/App.js

Screen Shot 2020-06-19 at 12 07 12

performance

Most helpful comment

Could this be related? I am getting this warning and cannot seem to figure out a way to get rid of it.

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.

All 4 comments

Could this be related? I am getting this warning and cannot seem to figure out a way to get rid of it.

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.

I have the same issue like @trivigy in a unit test with react testing library. Can't get rid of the warning.

I don't think that warning should be related.

I'm running into the same error as @trivigy and @ltwlf and can't figure out what's causing it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pesterhazy picture pesterhazy  路  4Comments

atanasster picture atanasster  路  3Comments

jamiewinder picture jamiewinder  路  3Comments

karevn picture karevn  路  3Comments

julienJean99 picture julienJean99  路  3Comments