Skip to content

Commit

Permalink
Add prepareForReuse to RCTSafeAreaViewComponentView
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sammy-SC authored and facebook-github-bot committed May 4, 2020
1 parent 8acb2b3 commit 577fdea
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ - (void)updateState:(facebook::react::State::Shared const &)state
[self _updateStateIfNecessary];
}

- (void)prepareForRecycle
{
[super prepareForRecycle];
_state.reset();
}

+ (ComponentDescriptorProvider)componentDescriptorProvider
{
return concreteComponentDescriptorProvider<SafeAreaViewComponentDescriptor>();
Expand Down

0 comments on commit 577fdea

Please sign in to comment.