diff --git a/packages/react/src/component/LayerContext.tsx b/packages/react/src/component/LayerContext.tsx index 4c6378a13c..4adf6479b1 100644 --- a/packages/react/src/component/LayerContext.tsx +++ b/packages/react/src/component/LayerContext.tsx @@ -1,7 +1,8 @@ import { ILayer } from '@antv/l7'; import { createContext, useContext } from 'react'; -export const LayerContext = createContext({}); +// tslint:disable-next-line: no-object-literal-type-assertion +export const LayerContext = createContext({} as ILayer); export function useLayerValue(): ILayer { return (useContext(LayerContext) as unknown) as ILayer; }