mirror of https://gitee.com/antv-l7/antv-l7
fix(react): 修复LayerContext类型问题
This commit is contained in:
parent
80626439e1
commit
2b9be52cfd
|
@ -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<ILayer | undefined>({} as ILayer);
|
||||
export function useLayerValue(): ILayer {
|
||||
return (useContext(LayerContext) as unknown) as ILayer;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue