【发布时间】:2021-06-28 13:01:16
【问题描述】:
我正在使用 React Context 并且我有:
const DocumentContext = createContext<
[DocumentStateType, React.Dispatch<any>, React.Dispatch<any>]
>([initVal, () => { }, () => { }]);
但我的 linter 抱怨:
Unexpected empty arrow function @typescript-eslint/no-empty-function
我知道我可以在我的 linting 设置中关闭它,但有正确的方法吗?
【问题讨论】:
-
() => undefined?和() => {}一样,但是body不是空的
标签: javascript reactjs typescript eslint use-context