Fix ViewManager.receiveCommand nullability (#44531)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44531

Changelog: [Internal]

Properly propagate the `Nullable` to the delegates.

Reviewed By: rshest

Differential Revision: D57218665

fbshipit-source-id: 2783ad9b37688e0928ad2e3cf6a2ab1f41190fe7
This commit is contained in:
Thomas Nardone
2024-05-14 09:21:15 -07:00
committed by Facebook GitHub Bot
parent 1a56b9a808
commit 6876775dc7
4 changed files with 5 additions and 5 deletions
@@ -74,7 +74,7 @@ const PropSetterTemplate = ({propCases}: {propCases: string}) =>
const CommandsTemplate = ({commandCases}: {commandCases: string}) =>
`
@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
switch (commandName) {
${commandCases}
}
@@ -213,7 +213,7 @@ public class CommandNativeComponentManagerDelegate<T extends View, U extends Bas
}
@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
switch (commandName) {
case \\"flashScrollIndicators\\":
mViewManager.flashScrollIndicators(view);
@@ -263,7 +263,7 @@ public class CommandNativeComponentManagerDelegate<T extends View, U extends Bas
}
@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
switch (commandName) {
case \\"handleRootTag\\":
mViewManager.handleRootTag(view, args.getDouble(0));
@@ -137,5 +137,5 @@ public abstract class BaseViewManagerDelegate<T extends View, U extends BaseView
}
@Override
public void receiveCommand(T view, String commandName, ReadableArray args) {}
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {}
}
@@ -21,5 +21,5 @@ import com.facebook.react.bridge.ReadableArray;
public interface ViewManagerDelegate<T extends View> {
void setProperty(T view, String propName, @Nullable Object value);
void receiveCommand(T view, String commandName, ReadableArray args);
void receiveCommand(T view, String commandName, @Nullable ReadableArray args);
}