Files
react-native/ReactCommon/fabric/components/textinput/androidtextinput/AndroidTextInputState.cpp
T
Joshua Gross da5ea0215a AndroidTextInput: keep track of mostRecentEventCount in C++ State
Summary:
Keep track of AndroidTextInput's mostRecentEventCount in C++ State.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18672368

fbshipit-source-id: ea7a635629050a6d4957cbcef6ec0bda5faaad9a
2019-11-27 12:55:47 -08:00

29 lines
816 B
C++

/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "AndroidTextInputState.h"
#include <react/components/text/conversions.h>
#include <react/debug/debugStringConvertibleUtils.h>
namespace facebook {
namespace react {
#ifdef ANDROID
folly::dynamic AndroidTextInputState::getDynamic() const {
folly::dynamic newState = folly::dynamic::object();
newState["mostRecentEventCount"] = mostRecentEventCount;
newState["attributedString"] = toDynamic(attributedString);
newState["paragraphAttributes"] = toDynamic(paragraphAttributes);
newState["hash"] = newState["attributedString"]["hash"];
return newState;
}
#endif
} // namespace react
} // namespace facebook