mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
fe887173ee
Summary: Changelog: [internal] Cloning of `LegacyViewManagerInteropViewProps` causes loss of `sourceProps.otherProps` if the cloning happens before shadow node is mounted. This was happening in WebView and callback `onLoadEnd` was dropped because of this. Reviewed By: JoshuaGross Differential Revision: D25474581 fbshipit-source-id: 74d7c5cd32b7318bb99306c82bc8b5e5eab63db2
30 lines
782 B
C++
30 lines
782 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 "LegacyViewManagerInteropViewProps.h"
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
static folly::dynamic recursiveMerge(
|
|
folly::dynamic const &lhs,
|
|
folly::dynamic const &rhs) {
|
|
auto copy = lhs;
|
|
copy.merge_patch(rhs);
|
|
return copy;
|
|
}
|
|
|
|
LegacyViewManagerInteropViewProps::LegacyViewManagerInteropViewProps(
|
|
const LegacyViewManagerInteropViewProps &sourceProps,
|
|
const RawProps &rawProps)
|
|
: ViewProps(sourceProps, rawProps),
|
|
otherProps(
|
|
recursiveMerge(sourceProps.otherProps, (folly::dynamic)rawProps)) {}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|