This repository has been archived by the owner on Jul 12, 2024. It is now read-only.
React warns about memory leak in Search
/SelectControl
component.
#6883
Labels
Describe the bug
Context: I discovered this bug fixing #6061
When the
Search
component is disconnected/unmounted before options promise is resolved, React throws a warning:That issue probably didn't surface before because the
Search
component has a single test that creates an instance, and the suite was probably finished before the promise resolves. However, it gets clearly visible, when you add a little bit of delay in the second test:See this commit/branch: https://github.com/woocommerce/woocommerce-admin/compare/bug/6883-Search-mem-leak
To Reproduce
Steps to reproduce the behavior:
<Search type="products" />
Alternatively:
Expected behavior
No warning should be thrown, no memory leak should be indicated.
Screenshots
Desktop (please complete the following information):
BrowserCLISmartphone (please complete the following information):
n/a
The text was updated successfully, but these errors were encountered: