Enable strictPropertyInitialization (#11203)

This commit is contained in:
Michael Telatynski
2023-07-07 14:46:12 +01:00
committed by GitHub
parent 4207d182cd
commit cfd48b36aa
38 changed files with 97 additions and 117 deletions

View File

@@ -41,7 +41,10 @@ export const useMap = ({ interactive, bodyId, onError }: UseMapProps): MapLibreM
try {
setMap(createMap(cli, !!interactive, bodyId, onError));
} catch (error) {
onError?.(error);
console.error("Error encountered in useMap", error);
if (error instanceof Error) {
onError?.(error);
}
}
return () => {
if (map) {