Skip to content

Commit a206e91

Browse files
makovkastarfacebook-github-bot
authored andcommitted
Generate super call to BaseViewManagerDelegate if delegate has no props
Summary: This diff adds a super call to `BaseViewManagerDelegate` if the current delegate doesn't have any props. We still want to set base view props, so we need `BaseViewManagerDelegate` to take care of this. Reviewed By: rickhanlonii Differential Revision: D16806648 fbshipit-source-id: 61963f2211cc7b2e7f5822c48bb0a7f50d909221
1 parent 0cf1c6d commit a206e91

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/react-native-codegen/src/generators/components/GeneratePropsJavaDelegate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function generatePropCasesString(
113113
componentName: string,
114114
) {
115115
if (component.props.length === 0) {
116-
return '// No props';
116+
return 'super.setProperty(view, propName, value);';
117117
}
118118

119119
const cases = component.props

packages/react-native-codegen/src/generators/components/__tests__/__snapshots__/GeneratePropsJavaDelegate-test.js.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public class CommandNativeComponentManagerDelegate<T extends View, U extends Bas
130130
}
131131
@Override
132132
public void setProperty(T view, String propName, @Nullable Object value) {
133-
// No props
133+
super.setProperty(view, propName, value);
134134
}
135135
136136
public void receiveCommand(CommandNativeComponentManagerInterface<T> viewManager, T view, String commandName, ReadableArray args) {
@@ -335,7 +335,7 @@ public class InterfaceOnlyComponentManagerDelegate<T extends View, U extends Bas
335335
}
336336
@Override
337337
public void setProperty(T view, String propName, @Nullable Object value) {
338-
// No props
338+
super.setProperty(view, propName, value);
339339
}
340340
}
341341
",
@@ -541,7 +541,7 @@ public class NoPropsNoEventsComponentManagerDelegate<T extends View, U extends B
541541
}
542542
@Override
543543
public void setProperty(T view, String propName, @Nullable Object value) {
544-
// No props
544+
super.setProperty(view, propName, value);
545545
}
546546
}
547547
",

0 commit comments

Comments
 (0)