mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
8cbbd93c40
Summary: This diff refactors the theme management for text input in order to avoid extra state updates. changelog:[Internal] Reviewed By: JoshuaGross Differential Revision: D22149754 fbshipit-source-id: 8a6dbe63c8d532986dbf785c7b16323e0a980669
30 lines
880 B
C++
30 lines
880 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 {
|
|
// Java doesn't need all fields, so we don't pass them along.
|
|
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
|