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:56:54 -07:00 коммит произвёл Facebook GitHub Bot
Родитель 8acb2b3a3e
Коммит 577fdeaa62
1 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -86,6 +86,12 @@ using namespace facebook::react;
[self _updateStateIfNecessary];
}
- (void)prepareForRecycle
{
[super prepareForRecycle];
_state.reset();
}
+ (ComponentDescriptorProvider)componentDescriptorProvider
{
return concreteComponentDescriptorProvider<SafeAreaViewComponentDescriptor>();