feature/ignore-self-toggle #1
@@ -83,6 +83,12 @@ function GeoLayer({
|
|||||||
[selectedCountry, onSelectCountry],
|
[selectedCountry, onSelectCountry],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// react-simple-maps types declare `path` as always defined, but it is
|
||||||
|
// undefined during early renders before the MapProvider context initialises.
|
||||||
|
// Cast through unknown to reflect the true runtime type and guard safely.
|
||||||
|
const safePath = path as unknown as typeof path | null;
|
||||||
|
if (safePath == null) return <></>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{(geographies as { rsmKey: string; id: string | number }[]).map(
|
{(geographies as { rsmKey: string; id: string | number }[]).map(
|
||||||
|
|||||||
Reference in New Issue
Block a user