From 2b9be52cfd0ece5891c7b79a3a9879a2f4b54357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=81=86=E4=B8=80?= Date: Thu, 27 Feb 2020 08:02:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(react):=20=E4=BF=AE=E5=A4=8DLayerContext?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react/src/component/LayerContext.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; }