Skip to content

Commit 4308185

Browse files
Tom Scallonfacebook-github-bot
authored andcommitted
Allow EventEmitters to be reported as optional (#53804)
Summary: Pull Request resolved: #53804 ## Changelog: [General] [Fixed] - Allow `EventEmitter`s to be optional (for push safety) Reviewed By: javache Differential Revision: D82509571 fbshipit-source-id: 801a22b10b2709968009527130cfa890d30a4f3a
1 parent d0d08e4 commit 4308185

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native-codegen/src/parsers/parsers-commons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ function buildEventEmitterSchema(
540540

541541
return {
542542
name: eventemitterName,
543-
optional: false,
543+
optional: Boolean(property.optional),
544544
typeAnnotation: {
545545
type: 'EventEmitterTypeAnnotation',
546546
typeAnnotation: eventTypeAnnotation,

0 commit comments

Comments
 (0)