facebookexperimental/Recoil

Memory leak when using atomFamily/selectorFamily

Open

#366 aperta il 19 giu 2020

Vedi su GitHub
 (22 commenti) (13 reazioni) (1 assegnatario)JavaScript (1151 fork)batch import
help wantedperformance

Metriche repository

Star
 (19.428 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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

Guida contributor