Make receiveCommand args non-nullable (#51806)

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

Correct the type of args, which is always non-null. This is backwards-compatible as subclasses can override this method with a more permissive nullable type and still be substitutable.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D75869317

fbshipit-source-id: 8f6c9119140794447eca55be24483a35450d7bb6
This commit is contained in:
Pieter De Baets
2025-06-06 22:07:09 -07:00
committed by Facebook GitHub Bot
parent 2c32bfa758
commit 198c6fc81c
18 changed files with 39 additions and 35 deletions
@@ -74,7 +74,7 @@ const PropSetterTemplate = ({propCases}: {propCases: string}) =>
const CommandsTemplate = ({commandCases}: {commandCases: string}) =>
`
@Override
public void receiveCommand(T view, String commandName, @Nullable ReadableArray args) {
public void receiveCommand(T view, String commandName, ReadableArray args) {
switch (commandName) {
${commandCases}
}