import React , { useImperativeHandle } from 'react' ; import { OverlayProps } from '@uiw/react-amap-map' ; import { useGeolocation } from './useGeolocation' ; export * from './useGeolocation' ; export interface GeolocationProps extends OverlayProps , AMap . GeolocationEvents , AMap . GeolocationOptions { default type ? : 'position' | 'cityInfo' ; } export const Geolocation = React . forwardRef < GeolocationProps , GeolocationProps > ( ( props , ref ) => { const { geolocation } = useGeolocation ( props ) ; useImperativeHandle ( ref , ( ) => ( { ... props , geolocation } ) ) ; return null ; } ) ;