microsoft / react-native-windows

A framework for building native Windows apps with React.
https://microsoft.github.io/react-native-windows/
Other
15.96k stars 1.13k forks source link

Should Paper/Fabric components share View Managers? #12753

Open TatianaKapos opened 2 months ago

TatianaKapos commented 2 months ago

Summary

Whie creating Fabric components, you need to also register them in Paper Views (when creating new methods or components that Fabric has but Paper doesn't), do we want to separate these or is it more useful to share code between the two?

Motivation

Cleaner code and separation between Fabric and Paper.

For example, currently we have an UnimplentedViewManager that holds Modal properties because Modal doesn't have a Paper-specific view manager. See: https://github.com/microsoft/react-native-windows/blob/main/vnext/Microsoft.ReactNative/Views/UnimplementedViewManager.cpp#L62

We also added the size property to Activity Indicator to be handled on the native-side on Fabric and had to add that property to the Paper ActivityIndicatorView Manager here: https://github.com/microsoft/react-native-windows/blob/main/vnext/Microsoft.ReactNative/Views/ActivityIndicatorViewManager.cpp#L26

Basic Example

No response

Open Questions

No response

acoates-ms commented 2 months ago

This will no longer be the case once we enable bridgeless mode - In bridgeless the paper UIManager and ViewManagers will no longer be instantiated at all.