-
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
Interface
does not require you to pass a delegate.On the other hand, your
RTNCenteredTextManager
needs to extend one of theViewManager
classes (i.e.SimpleViewManager
orBaseViewManager
or justViewManager
).The
ViewManager
class 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 thesetProperty
andreceiveCommand
.So in theory, you could avoid setting it, but your view won't work unles…