Add prepareForReuse to RCTSafeAreaViewComponentView

Summary:
Changelog: [internal]

As part of recycle, we should delete state. This is a common pattern used in other components as well.

Reviewed By: shergin

Differential Revision: D21348782

fbshipit-source-id: a5dee2f4ccee9b19498db31dab1983d8879dca71
This commit is contained in:
Samuel Susla
2020-05-04 02:59:19 -07:00
committed by Facebook GitHub Bot
parent 8acb2b3a3e
commit 577fdeaa62
@@ -86,6 +86,12 @@ using namespace facebook::react;
[self _updateStateIfNecessary];
}
- (void)prepareForRecycle
{
[super prepareForRecycle];
_state.reset();
}
+ (ComponentDescriptorProvider)componentDescriptorProvider
{
return concreteComponentDescriptorProvider<SafeAreaViewComponentDescriptor>();