/
githubmr
/
facebook-react-native
Обзор
Документация
Войти
/
githubmr
/
facebook-react-native
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
main
packages/rn-tester/NativeComponentExample/ios/RNTMyNativeViewManager.mm
44 строки
1 KB
generatedunixname89002005287564
Fix CQS signal readability-implicit-bool-conversion in xplat/js/react-native-github/packages (#53591)
04 сен 2025, 13:13
04 сен 2025, 13:13
4553f87
Код
Авторство
О чём код?
/* * 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. */ #import <React/RCTLog.h> #import <React/RCTUIManager.h> #import <React/RCTViewManager.h> #import "UIView+ColorOverlays.h" @interface RNTMyNativeViewManager : RCTViewManager @end @implementation RNTMyNativeViewManager RCT_EXPORT_MODULE(RNTMyNativeView) RCT_EXPORT_VIEW_PROPERTY(backgroundColor, UIColor) RCT_EXPORT_VIEW_PROPERTY(onIntArrayChanged, RCTBubblingEventBlock) RCT_EXPORT_VIEW_PROPERTY(values, NSArray *) RCT_EXPORT_METHOD(callNativeMethodToChangeBackgroundColor : (nonnull NSNumber *)reactTag color : (NSString *)color) { [self.bridge.uiManager addUIBlock:^(RCTUIManager *uiManager, NSDictionary<NSNumber *, UIView *> *viewRegistry) { UIView *view = viewRegistry[reactTag]; if ((view == nullptr) || ![view isKindOfClass:[UIView class]]) { RCTLogError(@"Cannot find NativeView with tag #%@", reactTag); return; } [view setBackgroundColorWithColorString:color]; }]; } - (UIView *)view { return [[UIView alloc] init]; } @end