diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManagerDelegate.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManagerDelegate.kt index 0903d4ae21e1f0..d110900aeb1f72 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManagerDelegate.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManagerDelegate.kt @@ -24,7 +24,7 @@ public abstract class BaseViewManagerDelegate< @Suppress("NoHungarianNotation") @JvmField protected val mViewManager: U ) : ViewManagerDelegate { @Suppress("DEPRECATION") - override public fun setProperty(view: T, propName: String, value: Any?) { + override public fun setProperty(view: T, propName: String?, value: Any?) { when (propName) { ViewProps.ACCESSIBILITY_ACTIONS -> mViewManager.setAccessibilityActions(view, value as ReadableArray?) @@ -143,6 +143,6 @@ public abstract class BaseViewManagerDelegate< } } - override public fun receiveCommand(view: T, commandName: String, args: ReadableArray?): Unit = + override public fun receiveCommand(view: T, commandName: String?, args: ReadableArray?): Unit = Unit } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerDelegate.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerDelegate.kt index 7fe89ee54bd255..53b96e54673601 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerDelegate.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagerDelegate.kt @@ -18,7 +18,24 @@ import com.facebook.react.bridge.ReadableArray * @param the type of the view supported by this delegate */ public interface ViewManagerDelegate { - public fun setProperty(view: T, propName: String, value: Any?) - public fun receiveCommand(view: T, commandName: String, args: ReadableArray?) + /** + * Sets a property on a view managed by this view manager. + * + * @param view the view to set the property on + * @param propName the name of the property to set (NOTE: should be `String` but is kept as + * `String?` to avoid breaking changes) + * @param value the value to set the property to + */ + public fun setProperty(view: T, propName: String?, value: Any?) + + /** + * Executes a command from JS to the view + * + * @param view the view to execute the command on + * @param commandName the name of the command to execute (NOTE: should be `String` but is kept as + * `String?` to avoid breaking changes) + * @param args the arguments to pass to the command + */ + public fun receiveCommand(view: T, commandName: String?, args: ReadableArray?) }