Fix useMap type (#1799)

This commit is contained in:
Xiaoji Chen 2022-03-10 08:11:48 -08:00 committed by GitHub
parent 74671ec92c
commit 29aa2098fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,7 +51,7 @@ export const MapProvider: React.FC<{}> = props => {
);
};
export function useMap(): {current?: MapRef; [id: string]: MapRef} {
export function useMap(): {current?: MapRef; [id: string]: MapRef | undefined} {
const maps = useContext(MountedMapsContext)?.maps;
const currentMap = useContext(MapContext);