diff --git a/src/components/Marker.js b/src/components/Marker.js index ed5dfaa..cb63cf5 100644 --- a/src/components/Marker.js +++ b/src/components/Marker.js @@ -24,7 +24,7 @@ const Marker = forwardRef( const [isPressed, setPressed] = useState(false) const [isFocused, setFocus] = useState(false) - const [x, y] = projection(coordinates) + const [x, y] = projection(coordinates) ?? [null, null] function handleMouseEnter(evt) { setFocus(true) @@ -59,29 +59,33 @@ const Marker = forwardRef( } return ( - + {x && y && + + {children} + } - {...restProps} - > - {children} - + ) } )