Skip to content

Commit 8caa6eb

Browse files
committed
tslint spik default context check
1 parent 42b922f commit 8caa6eb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/MentionsContext.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* tslint:disable: no-object-literal-type-assertion */
12
import createReactContext, { Context } from '@ant-design/create-react-context';
23
import * as React from 'react';
34
import { OptionProps } from './Option';
@@ -10,7 +11,10 @@ export interface MentionsContextProps {
1011
onFocus: () => void;
1112
}
1213

13-
const MentionsContext: Context<MentionsContextProps | null> = createReactContext(null);
14+
// We will never use default, here only to fix TypeScript warning
15+
const MentionsContext: Context<MentionsContextProps> = createReactContext(
16+
{} as MentionsContextProps,
17+
);
1418

1519
export const MentionsContextProvider = MentionsContext.Provider;
1620
export const MentionsContextConsumer = MentionsContext.Consumer;

0 commit comments

Comments
 (0)