Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo breaking change on ViewManagerDelegate.kt String params #47086

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public abstract class BaseViewManagerDelegate<
@Suppress("NoHungarianNotation") @JvmField protected val mViewManager: U
) : ViewManagerDelegate<T> {
@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?)
Expand Down Expand Up @@ -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
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,24 @@ import com.facebook.react.bridge.ReadableArray
* @param <T> the type of the view supported by this delegate </T>
*/
public interface ViewManagerDelegate<T : View?> {
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?)
}
Loading