/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/react-native/ReactCommon/react/renderer/components/image/ImageComponentDescriptor.cpp
30 строк
1 KB
Christoph Purrer
Allow to provide a custom TextLayoutManager for cxx platform (#48127)
07 дек 2024, 00:38
07 дек 2024, 00:38
d47ff26
Код
Авторство
О чём код?
/* * 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 "ImageComponentDescriptor.h" #include <react/renderer/imagemanager/ImageManager.h> namespace facebook::react { extern const char ImageManagerKey[] = "ImageManager"; ImageComponentDescriptor::ImageComponentDescriptor( const ComponentDescriptorParameters& parameters) : ConcreteComponentDescriptor(parameters), imageManager_( getManagerByName<ImageManager>(contextContainer_, ImageManagerKey)){}; void ImageComponentDescriptor::adopt(ShadowNode& shadowNode) const { ConcreteComponentDescriptor::adopt(shadowNode); auto& imageShadowNode = static_cast<ImageShadowNode&>(shadowNode); // `ImageShadowNode` uses `ImageManager` to initiate image loading and // communicate the loading state and results to mounting layer. imageShadowNode.setImageManager(imageManager_); } } // namespace facebook::react