mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook GitHub Bot
parent
1a56b9a808
commit
6876775dc7
+1
-1
@@ -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}
|
||||
}
|
||||
|
||||
+2
-2
@@ -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));
|
||||
|
||||
+1
-1
@@ -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) {}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user