diff --git a/change/@react-native-windows-codegen-4ec7c1b2-8541-47d9-a5d0-c245b25fbac1.json b/change/@react-native-windows-codegen-4ec7c1b2-8541-47d9-a5d0-c245b25fbac1.json new file mode 100644 index 00000000000..bcd71de956f --- /dev/null +++ b/change/@react-native-windows-codegen-4ec7c1b2-8541-47d9-a5d0-c245b25fbac1.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Fix issue with prop cloning with custom native props", + "packageName": "@react-native-windows/codegen", + "email": "53619745+rnbot@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/change/react-native-windows-621a9112-d00c-469f-83a8-ae391abefe18.json b/change/react-native-windows-621a9112-d00c-469f-83a8-ae391abefe18.json new file mode 100644 index 00000000000..0dfada2e568 --- /dev/null +++ b/change/react-native-windows-621a9112-d00c-469f-83a8-ae391abefe18.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "Fix issue with prop cloning with custom native props", + "packageName": "react-native-windows", + "email": "53619745+rnbot@users.noreply.github.com", + "dependentChangeType": "patch" +} diff --git a/packages/@react-native-windows/codegen/src/generators/GenerateComponentWindows.ts b/packages/@react-native-windows/codegen/src/generators/GenerateComponentWindows.ts index 769ec1fbaf9..f42fded8156 100644 --- a/packages/@react-native-windows/codegen/src/generators/GenerateComponentWindows.ts +++ b/packages/@react-native-windows/codegen/src/generators/GenerateComponentWindows.ts @@ -38,7 +38,14 @@ const headerTemplate = `/* const propsTemplate = `REACT_STRUCT(::_PROPS_NAME_::) struct ::_PROPS_NAME_:: : winrt::implements<::_PROPS_NAME_::, winrt::Microsoft::ReactNative::IComponentProps> { - ::_PROPS_NAME_::(winrt::Microsoft::ReactNative::ViewProps props) : ViewProps(props) {} + ::_PROPS_NAME_::(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) + : ViewProps(props) + { + if (cloneFrom) { + auto cloneFromProps = cloneFrom.as<::_PROPS_NAME_::>(); +::_PROP_INITIALIZERS_:: + } + } void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); @@ -144,8 +151,10 @@ void Register::_COMPONENT_NAME_::NativeComponent( L"::_COMPONENT_NAME_::", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { auto compBuilder = builder.as(); - builder.SetCreateProps( - [](winrt::Microsoft::ReactNative::ViewProps props) noexcept { return winrt::make<::_COMPONENT_NAME_::Props>(props); }); + builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, + const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { + return winrt::make<::_COMPONENT_NAME_::Props>(props, cloneFrom); + }); builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, const winrt::Microsoft::ReactNative::IComponentProps &newProps, @@ -296,6 +305,12 @@ export function createComponentGenerator({ }) .join('\n'); + const propInitializers = componentShape.props + .map(prop => { + return ` ${prop.name} = cloneFromProps->${prop.name};`; + }) + .join('\n'); + const propObjectTypes = propObjectAliases.jobs .map(propObjectTypeName => { const propObjectType = propObjectAliases.types[propObjectTypeName]!; @@ -510,6 +525,7 @@ ${ .replace(/::_EVENT_EMITTER_NAME_::/g, eventEmitterName) .replace(/::_PROPS_NAME_::/g, propsName) .replace(/::_COMPONENT_NAME_::/g, componentName) + .replace(/::_PROP_INITIALIZERS_::/g, propInitializers) .replace(/::_PROPS_FIELDS_::/g, propsFields) .replace(/::_NAMESPACE_::/g, namespace) .replace(/\n\n\n+/g, '\n\n'); diff --git a/packages/playground/windows/playground-composition/CustomComponent.cpp b/packages/playground/windows/playground-composition/CustomComponent.cpp index 8e7ea5e1878..80e5f9a643f 100644 --- a/packages/playground/windows/playground-composition/CustomComponent.cpp +++ b/packages/playground/windows/playground-composition/CustomComponent.cpp @@ -26,7 +26,15 @@ namespace winrt::PlaygroundApp::implementation { REACT_STRUCT(CustomXamlComponentProps) struct CustomXamlComponentProps : winrt::implements { - CustomXamlComponentProps(winrt::Microsoft::ReactNative::ViewProps props) : m_props(props) {} + CustomXamlComponentProps( + winrt::Microsoft::ReactNative::ViewProps props, + const winrt::Microsoft::ReactNative::IComponentProps &cloneFrom) + : m_props(props) { + if (cloneFrom) { + auto cloneFromProps = cloneFrom.as(); + label = cloneFromProps->label; + } + } void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); @@ -139,8 +147,9 @@ struct CustomComponentUserData : winrt::implements(props); + builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, + const winrt::Microsoft::ReactNative::IComponentProps &cloneFrom) noexcept { + return winrt::make(props, cloneFrom); }); builder.SetFinalizeUpdateHandler([](const winrt::Microsoft::ReactNative::ComponentView &source, diff --git a/packages/sample-custom-component/codegen/react/components/SampleCustomComponent/DrawingIsland.g.h b/packages/sample-custom-component/codegen/react/components/SampleCustomComponent/DrawingIsland.g.h index dc008038e3e..90109030016 100644 --- a/packages/sample-custom-component/codegen/react/components/SampleCustomComponent/DrawingIsland.g.h +++ b/packages/sample-custom-component/codegen/react/components/SampleCustomComponent/DrawingIsland.g.h @@ -13,7 +13,14 @@ namespace winrt::SampleCustomComponent::Codegen { REACT_STRUCT(DrawingIslandProps) struct DrawingIslandProps : winrt::implements { - DrawingIslandProps(winrt::Microsoft::ReactNative::ViewProps props) : ViewProps(props) {} + DrawingIslandProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) + : ViewProps(props) + { + if (cloneFrom) { + auto cloneFromProps = cloneFrom.as(); + + } + } void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); @@ -92,8 +99,10 @@ void RegisterDrawingIslandNativeComponent( L"DrawingIsland", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { auto compBuilder = builder.as(); - builder.SetCreateProps( - [](winrt::Microsoft::ReactNative::ViewProps props) noexcept { return winrt::make(props); }); + builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, + const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { + return winrt::make(props, cloneFrom); + }); builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, const winrt::Microsoft::ReactNative::IComponentProps &newProps, diff --git a/packages/sample-custom-component/codegen/react/components/SampleCustomComponent/MovingLight.g.h b/packages/sample-custom-component/codegen/react/components/SampleCustomComponent/MovingLight.g.h index 35859463a4f..94619f9dec1 100644 --- a/packages/sample-custom-component/codegen/react/components/SampleCustomComponent/MovingLight.g.h +++ b/packages/sample-custom-component/codegen/react/components/SampleCustomComponent/MovingLight.g.h @@ -22,7 +22,17 @@ struct MovingLightSpec_MovingLightProps_objectProp { REACT_STRUCT(MovingLightProps) struct MovingLightProps : winrt::implements { - MovingLightProps(winrt::Microsoft::ReactNative::ViewProps props) : ViewProps(props) {} + MovingLightProps(winrt::Microsoft::ReactNative::ViewProps props, const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) + : ViewProps(props) + { + if (cloneFrom) { + auto cloneFromProps = cloneFrom.as(); + size = cloneFromProps->size; + color = cloneFromProps->color; + eventParam = cloneFromProps->eventParam; + objectProp = cloneFromProps->objectProp; + } + } void SetProp(uint32_t hash, winrt::hstring propName, winrt::Microsoft::ReactNative::IJSValueReader value) noexcept { winrt::Microsoft::ReactNative::ReadProp(hash, propName, value, *this); @@ -142,8 +152,10 @@ void RegisterMovingLightNativeComponent( L"MovingLight", [builderCallback](winrt::Microsoft::ReactNative::IReactViewComponentBuilder const &builder) noexcept { auto compBuilder = builder.as(); - builder.SetCreateProps( - [](winrt::Microsoft::ReactNative::ViewProps props) noexcept { return winrt::make(props); }); + builder.SetCreateProps([](winrt::Microsoft::ReactNative::ViewProps props, + const winrt::Microsoft::ReactNative::IComponentProps& cloneFrom) noexcept { + return winrt::make(props, cloneFrom); + }); builder.SetUpdatePropsHandler([](const winrt::Microsoft::ReactNative::ComponentView &view, const winrt::Microsoft::ReactNative::IComponentProps &newProps, diff --git a/packages/sample-custom-component/windows/SampleCustomComponent/MovingLight.cpp b/packages/sample-custom-component/windows/SampleCustomComponent/MovingLight.cpp index 85853547610..d2dfa2b18ea 100644 --- a/packages/sample-custom-component/windows/SampleCustomComponent/MovingLight.cpp +++ b/packages/sample-custom-component/windows/SampleCustomComponent/MovingLight.cpp @@ -18,8 +18,6 @@ struct MovingLight : public winrt::implements, auto view = sender.as(); if (!oldProps || oldProps->color != newProps->color) { m_spotlight.InnerConeColor(newProps->color.AsWindowsColor(view.Theme())); - } else { - m_spotlight.InnerConeColor(winrt::Windows::UI::Colors::FloralWhite()); } if (!oldProps || oldProps->size != newProps->size) { diff --git a/vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp b/vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp index e4fa49bbee6..4a717fd8e4d 100644 --- a/vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/AbiComponentDescriptor.cpp @@ -106,7 +106,10 @@ facebook::react::Props::Shared AbiComponentDescriptor::cloneProps( rawProps); auto userProps = winrt::get_self(m_builder) - ->CreateProps(nullptr); + ->CreateProps( + nullptr, + props ? static_cast(*props).UserProps() + : nullptr); shadowNodeProps->SetUserProps(userProps); const auto &dynamic = static_cast(rawProps); diff --git a/vnext/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp b/vnext/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp index 20f41f2de27..95e582ff0df 100644 --- a/vnext/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/AbiViewComponentDescriptor.cpp @@ -103,7 +103,7 @@ facebook::react::Props::Shared AbiViewComponentDescriptor::cloneProps( winrt::make(shadowNodeProps, false /*holdRef*/); auto userProps = winrt::get_self(m_builder) - ->CreateProps(viewProps); + ->CreateProps(viewProps, props ? static_cast(*props).UserProps() : nullptr); shadowNodeProps->SetUserProps(userProps, viewProps); const auto &dynamic = static_cast(rawProps); diff --git a/vnext/Microsoft.ReactNative/Fabric/AbiViewProps.cpp b/vnext/Microsoft.ReactNative/Fabric/AbiViewProps.cpp index d89b520b357..02263560c72 100644 --- a/vnext/Microsoft.ReactNative/Fabric/AbiViewProps.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/AbiViewProps.cpp @@ -65,6 +65,13 @@ winrt::Microsoft::ReactNative::Composition::Experimental::IBrush Color::AsIntern return winrt::get_self(theme)->Brush(*m_color); } +bool Color::Equals(const winrt::Microsoft::ReactNative::Color &color) const noexcept { + if (!color) { + return false; + } + return m_color == winrt::get_self(color)->m_color; +} + winrt::Microsoft::ReactNative::Color Color::ReadValue( const winrt::Microsoft::ReactNative::IJSValueReader &reader) noexcept { switch (reader.ValueType()) { diff --git a/vnext/Microsoft.ReactNative/Fabric/AbiViewProps.h b/vnext/Microsoft.ReactNative/Fabric/AbiViewProps.h index 6269e7f118c..c5391b6d92c 100644 --- a/vnext/Microsoft.ReactNative/Fabric/AbiViewProps.h +++ b/vnext/Microsoft.ReactNative/Fabric/AbiViewProps.h @@ -50,6 +50,8 @@ struct Color : ColorT { winrt::Microsoft::ReactNative::Composition::Experimental::IBrush AsInternalBrush( const winrt::Microsoft::ReactNative::Composition::Theme theme) noexcept; + bool Equals(const winrt::Microsoft::ReactNative::Color &color) const noexcept; + static winrt::Microsoft::ReactNative::Color ReadValue( const winrt::Microsoft::ReactNative::IJSValueReader &reader) noexcept; static void WriteValue( diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp index e073fdb172f..51c3f6b240d 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.cpp @@ -420,6 +420,10 @@ void ComponentView::ReleasePointerCapture( ->ReleasePointerCapture(pointer, static_cast(Tag())); } +void ComponentView::SetViewFeatures(ComponentViewFeatures viewFeatures) noexcept { + m_flags = viewFeatures; +} + RECT ComponentView::getClientRect() const noexcept { RECT rc{0}; facebook::react::Point parentOffset{0}; diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h index 2c79f512e16..94b74bdbb10 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/CompositionViewComponentView.h @@ -55,6 +55,7 @@ struct ComponentView : public ComponentViewT< void onGotFocus(const winrt::Microsoft::ReactNative::Composition::Input::RoutedEventArgs &args) noexcept override; bool CapturePointer(const winrt::Microsoft::ReactNative::Composition::Input::Pointer &pointer) noexcept; void ReleasePointerCapture(const winrt::Microsoft::ReactNative::Composition::Input::Pointer &pointer) noexcept; + void SetViewFeatures(ComponentViewFeatures viewFeatures) noexcept; std::vector supplementalComponentDescriptorProviders() noexcept override; diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp b/vnext/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp index 02b06f945c8..7059334941f 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.cpp @@ -21,8 +21,10 @@ void ReactCompositionViewComponentBuilder::SetCreateProps(ViewPropsFactory impl) m_propsFactory = impl; } -IComponentProps ReactCompositionViewComponentBuilder::CreateProps(ViewProps props) noexcept { - return m_propsFactory(props); +IComponentProps ReactCompositionViewComponentBuilder::CreateProps( + ViewProps props, + const IComponentProps &cloneFrom) noexcept { + return m_propsFactory(props, cloneFrom); } void ReactCompositionViewComponentBuilder::CreateShadowNode(ShadowNode shadowNode) noexcept { @@ -72,12 +74,15 @@ void ReactCompositionViewComponentBuilder::InitializeComponentView( void ReactCompositionViewComponentBuilder::SetComponentViewInitializer( const ComponentViewInitializer &initializer) noexcept { - m_fnCreateView = - [initializer](const IReactContext &reactContext, int32_t tag, const Experimental::ICompositionContext &context) { - auto view = winrt::make(tag, reactContext); - initializer(view); - return view; - }; + m_fnCreateView = [initializer]( + const IReactContext &reactContext, + int32_t tag, + const Experimental::ICompositionContext &context, + ComponentViewFeatures) { + auto view = winrt::make(tag, reactContext); + initializer(view); + return view; + }; m_descriptorConstructorFactory = []() { return &facebook::react::concreteComponentDescriptorConstructor<::Microsoft::ReactNative::AbiComponentDescriptor>; }; @@ -85,14 +90,16 @@ void ReactCompositionViewComponentBuilder::SetComponentViewInitializer( void ReactCompositionViewComponentBuilder::SetViewComponentViewInitializer( const ViewComponentViewInitializer &initializer) noexcept { - m_fnCreateView = - [initializer](const IReactContext &reactContext, int32_t tag, const Experimental::ICompositionContext &context) { - auto view = winrt::Microsoft::ReactNative::Composition::implementation::ViewComponentView::Create( - context, tag, reactContext) - .as(); - initializer(view); - return view; - }; + m_fnCreateView = [initializer]( + const IReactContext &reactContext, + int32_t tag, + const Experimental::ICompositionContext &context, + ComponentViewFeatures features) { + auto view = winrt::make( + implementation::ViewComponentView::defaultProps(), context, tag, reactContext, features); + initializer(view); + return view; + }; m_descriptorConstructorFactory = []() { return &facebook::react::concreteComponentDescriptorConstructor< ::Microsoft::ReactNative::AbiViewComponentDescriptor>; @@ -101,9 +108,12 @@ void ReactCompositionViewComponentBuilder::SetViewComponentViewInitializer( void ReactCompositionViewComponentBuilder::SetContentIslandComponentViewInitializer( const ComponentIslandComponentViewInitializer &initializer) noexcept { - m_fnCreateView = [initializer]( - const IReactContext &reactContext, int32_t tag, const Experimental::ICompositionContext &context) - -> winrt::Microsoft::ReactNative::Composition::ContentIslandComponentView { + m_fnCreateView = + [initializer]( + const IReactContext &reactContext, + int32_t tag, + const Experimental::ICompositionContext &context, + ComponentViewFeatures) -> winrt::Microsoft::ReactNative::Composition::ContentIslandComponentView { auto view = winrt::make( context, tag, reactContext); initializer(view); @@ -186,12 +196,16 @@ void ReactCompositionViewComponentBuilder::SetCreateVisualHandler(CreateVisualDe m_createVisualHandler = impl; } +void ReactCompositionViewComponentBuilder::SetViewFeatures(ComponentViewFeatures viewFeatures) noexcept { + m_features = viewFeatures; +} + winrt::Microsoft::ReactNative::ComponentView ReactCompositionViewComponentBuilder::CreateView( const IReactContext &reactContext, int32_t tag, const Experimental::ICompositionContext &context) noexcept { assert(m_fnCreateView); - auto view = m_fnCreateView(reactContext, tag, context); + auto view = m_fnCreateView(reactContext, tag, context, m_features); InitializeComponentView(view); return view; } diff --git a/vnext/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h b/vnext/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h index 14e1a21ff11..220884bd6c6 100644 --- a/vnext/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h +++ b/vnext/Microsoft.ReactNative/Fabric/Composition/ReactCompositionViewComponentBuilder.h @@ -42,11 +42,11 @@ struct ReactCompositionViewComponentBuilder : winrt::implements< public: // Composition::IReactCompositionViewComponentBuilder void SetViewComponentViewInitializer(const ViewComponentViewInitializer &initializer) noexcept; void SetContentIslandComponentViewInitializer(const ComponentIslandComponentViewInitializer &initializer) noexcept; - void SetCreateVisualHandler(CreateVisualDelegate impl) noexcept; + void SetViewFeatures(ComponentViewFeatures viewFeatures) noexcept; public: - IComponentProps CreateProps(ViewProps props) noexcept; + IComponentProps CreateProps(ViewProps props, const IComponentProps &cloneFrom) noexcept; void CreateShadowNode(ShadowNode shadowNode) noexcept; void CloneShadowNode(ShadowNode shadowNode, ShadowNode sourceShadowNode) noexcept; winrt::Windows::Foundation::IInspectable InitialStateData( @@ -69,10 +69,12 @@ struct ReactCompositionViewComponentBuilder : winrt::implements< InitialStateDataFactory m_initialStateDataFactory; winrt::Microsoft::ReactNative::MeasureContentHandler m_measureContent; winrt::Microsoft::ReactNative::LayoutHandler m_layoutHandler; + ComponentViewFeatures m_features{ComponentViewFeatures::Default}; std::function + const Experimental::ICompositionContext &context, + ComponentViewFeatures features)> m_fnCreateView; std::function m_descriptorConstructorFactory; winrt::Microsoft::ReactNative::HandleCommandDelegate m_customCommandHandler; diff --git a/vnext/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl b/vnext/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl index 2c0660c2908..021103285d9 100644 --- a/vnext/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl +++ b/vnext/Microsoft.ReactNative/IReactCompositionViewComponentBuilder.idl @@ -33,6 +33,7 @@ namespace Microsoft.ReactNative.Composition void SetViewComponentViewInitializer(ViewComponentViewInitializer initializer); void SetContentIslandComponentViewInitializer(ComponentIslandComponentViewInitializer initializer); void SetCreateVisualHandler(CreateVisualDelegate impl); + void SetViewFeatures(ComponentViewFeatures viewFeatures); }; } // namespace Microsoft.ReactNative diff --git a/vnext/Microsoft.ReactNative/IReactViewComponentBuilder.idl b/vnext/Microsoft.ReactNative/IReactViewComponentBuilder.idl index 4de452ce1d9..fa2197a0596 100644 --- a/vnext/Microsoft.ReactNative/IReactViewComponentBuilder.idl +++ b/vnext/Microsoft.ReactNative/IReactViewComponentBuilder.idl @@ -56,7 +56,7 @@ namespace Microsoft.ReactNative [experimental] DOC_STRING("A delegate that creates a @IComponentProps object for an instance of @ViewProps. See @IReactViewComponentBuilder.SetCreateProps") - delegate IComponentProps ViewPropsFactory(ViewProps props); + delegate IComponentProps ViewPropsFactory(ViewProps props, IComponentProps cloneFrom); [experimental] delegate Windows.Foundation.Size MeasureContentHandler(ShadowNode shadowNode, LayoutContext layoutContext, LayoutConstraints layoutConstraints); diff --git a/vnext/Microsoft.ReactNative/ViewProps.idl b/vnext/Microsoft.ReactNative/ViewProps.idl index 01cedda350d..577bb33af71 100644 --- a/vnext/Microsoft.ReactNative/ViewProps.idl +++ b/vnext/Microsoft.ReactNative/ViewProps.idl @@ -24,6 +24,8 @@ namespace Microsoft.ReactNative { Microsoft.UI.Composition.CompositionBrush AsBrush(Microsoft.ReactNative.Composition.Theme theme); #endif + Boolean Equals(Color color); + static Color Black(); static Color Transparent(); static Color ReadValue(IJSValueReader reader);