Fabric: Proper implementation of -[RCTViewComponentView prepareForRecycle]

Summary: RCTViewComponentView retains an EventEmitter, so we have to clear this up after we recyled the view.

Reviewed By: sahrens

Differential Revision: D13196884

fbshipit-source-id: e9f2e2400be864c5c6177227255012101ed8c4d1
This commit is contained in:
Valentin Shergin
2018-11-26 13:48:56 -08:00
committed by Facebook Github Bot
parent 7fe3f90156
commit ffd2409172

View File

@@ -267,6 +267,12 @@ using namespace facebook::react;
[self invalidateLayer];
}
- (void)prepareForRecycle
{
[super prepareForRecycle];
_eventEmitter.reset();
}
- (UIView *)betterHitTest:(CGPoint)point withEvent:(UIEvent *)event
{
// This is a classic textbook implementation of `hitTest:` with a couple of improvements: