/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/ReactCommon/react/renderer/components/unimplementedview/UnimplementedViewProps.cpp
41 строка
1 KB
Nick Lefever
Use RN_SERIALIZABLE_STATE for conditional getDiffProps code (#51516)
22 май 2025, 13:11
22 май 2025, 13:11
f900551
Код
Авторство
О чём код?
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <react/renderer/components/unimplementedview/UnimplementedViewProps.h> namespace facebook::react { void UnimplementedViewProps::setComponentName(ComponentName componentName) { componentName_ = componentName; } ComponentName UnimplementedViewProps::getComponentName() const { return componentName_; } #ifdef RN_SERIALIZABLE_STATE folly::dynamic UnimplementedViewProps::getDiffProps( const Props* prevProps) const { static const auto defaultProps = UnimplementedViewProps(); const UnimplementedViewProps* oldProps = prevProps == nullptr ? &defaultProps : static_cast<const UnimplementedViewProps*>(prevProps); folly::dynamic result = ViewProps::getDiffProps(oldProps); if (componentName_ != oldProps->componentName_) { result["name"] = componentName_; } return result; } #endif } // namespace facebook::react