-
|
When migrating a component to Fabric, there is a step documented here https://reactnative.dev/docs/next/the-new-architecture/pillars-fabric-components#centeredtextmanagerjava which adds the following I'd like to know what the purpose of the delegate is. Is it mandatory? Implementing the Thank you! :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hi @vonovak,
You're right in saying that the generated The So in theory, you could avoid setting it, but your view won't work unless you wire all the |
Beta Was this translation helpful? Give feedback.
Hi @vonovak,
Happy to respond,
You're right in saying that the generated
Interfacedoes not require you to pass a delegate.On the other hand, your
RTNCenteredTextManagerneeds to extend one of theViewManagerclasses (i.e.SimpleViewManagerorBaseViewManageror justViewManager).The
ViewManagerclass however has agetDelegate()method which can be used to pass aViewManagerDelegate. This class is conveniently generated for you by the codegen, and will take care of all the wiring for thesetPropertyandreceiveCommand.So in theory, you could avoid setting it, but your view won't work unles…