Skip to content

Commit 48ed4cb

Browse files
author
Brian Vaughn
committed
Added displayName to internal Context Flow type
1 parent 757c6f8 commit 48ed4cb

File tree

14 files changed

+28
-25
lines changed

14 files changed

+28
-25
lines changed

packages/react-devtools-shared/src/__tests__/inspectedElementContext-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ describe('InspectedElementContext', () => {
148148

149149
// Modern Context API
150150
const BoolContext = React.createContext(contextData.bool);
151-
(BoolContext: any).displayName = 'BoolContext';
151+
BoolContext.displayName = 'BoolContext';
152152

153153
class ModernContextType extends React.Component<any> {
154154
static contextType = BoolContext;
@@ -158,7 +158,7 @@ describe('InspectedElementContext', () => {
158158
}
159159

160160
const ModernContext = React.createContext();
161-
(ModernContext: any).displayName = 'ModernContext';
161+
ModernContext.displayName = 'ModernContext';
162162

163163
const container = document.createElement('div');
164164
await utils.actAsync(() =>

packages/react-devtools-shared/src/devtools/views/Components/InspectedElementContext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export type InspectedElementContextType = {|
6161
const InspectedElementContext = createContext<InspectedElementContextType>(
6262
((null: any): InspectedElementContextType),
6363
);
64-
(InspectedElementContext: any).displayName = 'InspectedElementContext';
64+
InspectedElementContext.displayName = 'InspectedElementContext';
6565

6666
type ResolveFn = (inspectedElement: InspectedElementFrontend) => void;
6767
type InProgressRequest = {|

packages/react-devtools-shared/src/devtools/views/Components/NativeStyleEditor/context.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type Context = {|
4242
|};
4343

4444
const NativeStyleContext = createContext<Context>(((null: any): Context));
45-
(NativeStyleContext: any).displayName = 'NativeStyleContext';
45+
NativeStyleContext.displayName = 'NativeStyleContext';
4646

4747
type ResolveFn = (styleAndLayout: StyleAndLayoutFrontend) => void;
4848
type InProgressRequest = {|

packages/react-devtools-shared/src/devtools/views/Components/OwnersListContext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import type {Resource, Thenable} from '../../cache';
2424
type Context = (id: number) => Array<Owner> | null;
2525

2626
const OwnersListContext = createContext<Context>(((null: any): Context));
27-
(OwnersListContext: any).displayName = 'OwnersListContext';
27+
OwnersListContext.displayName = 'OwnersListContext';
2828

2929
type ResolveFn = (ownersList: Array<Owner> | null) => void;
3030
type InProgressRequest = {|

packages/react-devtools-shared/src/devtools/views/Components/TreeContext.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,12 @@ export type DispatcherContext = (action: Action) => void;
130130
const TreeStateContext = createContext<StateContext>(
131131
((null: any): StateContext),
132132
);
133-
(TreeStateContext: any).displayName = 'TreeStateContext';
133+
TreeStateContext.displayName = 'TreeStateContext';
134134

135135
const TreeDispatcherContext = createContext<DispatcherContext>(
136136
((null: any): DispatcherContext),
137137
);
138-
(TreeDispatcherContext: any).displayName = 'TreeDispatcherContext';
138+
TreeDispatcherContext.displayName = 'TreeDispatcherContext';
139139

140140
type State = {|
141141
// Tree

packages/react-devtools-shared/src/devtools/views/Components/ViewElementSourceContext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ export type Context = {|
2020
|};
2121

2222
const ViewElementSourceContext = createContext<Context>(((null: any): Context));
23-
(ViewElementSourceContext: any).displayName = 'ViewElementSourceContext';
23+
ViewElementSourceContext.displayName = 'ViewElementSourceContext';
2424

2525
export default ViewElementSourceContext;

packages/react-devtools-shared/src/devtools/views/ModalDialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type ModalDialogContextType = {|
5050
const ModalDialogContext = createContext<ModalDialogContextType>(
5151
((null: any): ModalDialogContextType),
5252
);
53-
(ModalDialogContext: any).displayName = 'ModalDialogContext';
53+
ModalDialogContext.displayName = 'ModalDialogContext';
5454

5555
function dialogReducer(state, action) {
5656
switch (action.type) {

packages/react-devtools-shared/src/devtools/views/Profiler/ProfilerContext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export type Context = {|
7171
|};
7272

7373
const ProfilerContext = createContext<Context>(((null: any): Context));
74-
(ProfilerContext: any).displayName = 'ProfilerContext';
74+
ProfilerContext.displayName = 'ProfilerContext';
7575

7676
type StoreProfilingState = {|
7777
didRecordCommits: boolean,

packages/react-devtools-shared/src/devtools/views/Settings/SettingsContext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ type Context = {|
4848
|};
4949

5050
const SettingsContext = createContext<Context>(((null: any): Context));
51-
(SettingsContext: any).displayName = 'SettingsContext';
51+
SettingsContext.displayName = 'SettingsContext';
5252

5353
type DocumentElements = Array<HTMLElement>;
5454

packages/react-devtools-shared/src/devtools/views/Settings/SettingsModalContext.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type Context = {
2020
};
2121

2222
const SettingsModalContext = createContext<Context>(((null: any): Context));
23-
(SettingsModalContext: any).displayName = 'SettingsModalContext';
23+
SettingsModalContext.displayName = 'SettingsModalContext';
2424

2525
function SettingsModalContextController({children}: {|children: React$Node|}) {
2626
const [isModalShowing, setIsModalShowing] = useState<boolean>(false);

0 commit comments

Comments
 (0)