diff --git a/packages/marker/src/useMarker.tsx b/packages/marker/src/useMarker.tsx index 57ad1db2f..ab2c9306a 100644 --- a/packages/marker/src/useMarker.tsx +++ b/packages/marker/src/useMarker.tsx @@ -21,7 +21,8 @@ export const useMarker = (props: UseMarker = {}) => { } return () => { if (marker) { - marker.remove(); + // @fix [244] https://github.com/uiwjs/react-amap/issues/244 + typeof marker.remove === 'function' && marker.remove(); setMarker(undefined); } };