@samitouri / QOS-React-2 / commits / b962adfc2b

[Flare] event component displayName is now mandatory (#15717)

Dominic Gannaway committed May 23, 2019 at 01:29 UTC b962adfc2b979e5526ee099fd43366db7abfcc47
2 files changed +2 -5
packages/shared/ReactTypes.js
+1 -1
@@ -137,7 +137,7 @@ export type ReactEventComponentInstance = {|
137
138 export type ReactEventComponent = {|
139 $$typeof: Symbol | number,
140 - displayName?: string,
140 + displayName: string,
141 props: null | Object,
142 responder: ReactEventResponder,
143 |};
packages/shared/getComponentName.js
+1 -4
@@ -95,10 +95,7 @@ function getComponentName(type: mixed): string | null {
95 case REACT_EVENT_COMPONENT_TYPE: {
96 if (enableEventAPI) {
97 const eventComponent = ((type: any): ReactEventComponent);
98 - const displayName = eventComponent.displayName;
99 - if (displayName !== undefined) {
100 - return displayName;
101 - }
98 + return eventComponent.displayName;
99 }
100 break;
101 }