File tree 2 files changed +11
-2
lines changed
packages/react-dom/src/client 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ export function precacheFiberNode(
40
40
( node : any ) [ internalInstanceKey ] = hostInst ;
41
41
}
42
42
43
+ export function clearFiberNode (
44
+ node : Instance | TextInstance | SuspenseInstance ,
45
+ ) : void {
46
+ ( node : any ) [ internalInstanceKey ] = null ;
47
+ }
48
+
43
49
export function markContainerAsRoot ( hostRoot : Fiber , node : Container ) : void {
44
50
node [ internalContainerInstanceKey ] = hostRoot ;
45
51
}
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
19
19
precacheFiberNode ,
20
20
updateFiberProps ,
21
21
getClosestInstanceFromNode ,
22
+ clearFiberNode ,
22
23
} from './ReactDOMComponentTree' ;
23
24
import {
24
25
createElement ,
@@ -522,8 +523,10 @@ function dispatchAfterDetachedBlur(target: HTMLElement): void {
522
523
523
524
export function beforeRemoveInstance (
524
525
instance : Instance | TextInstance | SuspenseInstance ,
525
- ) {
526
- // TODO for ReactDOM.createEventInstance
526
+ ) : void {
527
+ // Clear the fiber off the instance, to help GC
528
+ clearFiberNode ( instance ) ;
529
+ // TODO handle ReactDOM.createEventInstance
527
530
}
528
531
529
532
export function removeChild (
You can’t perform that action at this time.
0 commit comments