facebookexperimental/Recoil

Memory leak when using atomFamily/selectorFamily

开放

#366 创建于 2020年6月19日

 (22 条评论) (13 个反应) (1 位负责人)JavaScript (1,151 个派生)batch import
help wantedperformance

仓库指标

星标
 (19,428 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

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

贡献者指南