Closed malash closed 1 year ago
According to the doc of createInstance of React reconciler, we should register event handle in the commitMount hook instead of createInstance. Otherwise, it may cause a memory leak problem with error bonding or suspense.
commitMount
createInstance
For more details, please see the packages/core/src/reconciler/__tests__/commitMount.test.tsx file in this PR. The reproduction demo is inspired from https://github.com/facebook/react/issues/20271#issuecomment-728526557 .
packages/core/src/reconciler/__tests__/commitMount.test.tsx
According to the doc of createInstance of React reconciler, we should register event handle in the
commitMount
hook instead ofcreateInstance
. Otherwise, it may cause a memory leak problem with error bonding or suspense.For more details, please see the
packages/core/src/reconciler/__tests__/commitMount.test.tsx
file in this PR. The reproduction demo is inspired from https://github.com/facebook/react/issues/20271#issuecomment-728526557 .