import React from 'react' ; import Map , { MapProps } from '@uiw/react-baidu-map-map' ; export interface WithMapProps { BMap ? : typeof BMap ; container ? : string | HTMLDivElement ; map ? : BMap . Map ; } export default function withMap ( Comp ) { return React . forwardRef ( ( props , ref ? ) => ( < Map { ... props } > { ( mapProps ) => { return < Comp ref = { ref } { ... props } { ... mapProps } / > ; } } < /Map>)); }