facebookexperimental/Recoil

Memory leak when using atomFamily/selectorFamily

オープン

#366 opened on 2020/06/19

 (22 件のコメント) (13 件のリアクション) (1 人の担当者)JavaScript (1,151 件のフォーク)batch import
help wantedperformance

Repository metrics

Stars
 (19,428 個のスター)
PR merge metrics
 (PR metrics pending)

説明

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

コントリビューターガイド