diff --git a/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm b/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm index d151d1c0c3..e53c8570d9 100644 --- a/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +++ b/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm @@ -41,7 +41,7 @@ static UIView *_Nullable RCTFindTextInputWithNat } @implementation RCTInputAccessoryComponentView { - InputAccessoryShadowNode::ConcreteStateTeller _stateTeller; + InputAccessoryShadowNode::ConcreteState::Shared _state; RCTInputAccessoryContentView *_contentView; RCTSurfaceTouchHandler *_touchHandler; UIView __weak *_textInput; @@ -118,15 +118,16 @@ static UIView *_Nullable RCTFindTextInputWithNat self.hidden = true; } -- (void)updateState:(State::Shared const &)state oldState:(State::Shared const &)oldState +- (void)updateState:(const facebook::react::State::Shared &)state + oldState:(const facebook::react::State::Shared &)oldState { - _stateTeller.setConcreteState(state); - CGSize oldViewportSize = RCTCGSizeFromSize(_stateTeller.getData().value().viewportSize); + _state = std::static_pointer_cast(state); + CGSize oldScreenSize = RCTCGSizeFromSize(_state->getData().viewportSize); CGSize viewportSize = RCTViewportSize(); viewportSize.height = std::nan(""); - if (oldViewportSize.width != viewportSize.width) { + if (oldScreenSize.width != viewportSize.width) { auto stateData = InputAccessoryState{RCTSizeFromCGSize(viewportSize)}; - _stateTeller.updateState(std::move(stateData)); + _state->updateState(std::move(stateData)); } } @@ -141,7 +142,7 @@ static UIView *_Nullable RCTFindTextInputWithNat - (void)prepareForRecycle { [super prepareForRecycle]; - _stateTeller.invalidate(); + _state.reset(); _textInput = nil; }