React component for responsive map-area HTML-tags
npm install --save react-responsive-maparea
yarn add react-responsive-maparea
import React, { Component, useRef } from 'react'
import { Map, Area } from 'react-responsive-maparea'
const Example = () => {
const imgRef = useRef<HTMLImageElement>(null);
return (
<div>
<Map name='map' imgRef={imgRef}>
<Area
shape='rect'
coords='0,0,100,50'
href='https://google.com'
/>
</Map>
<img
ref={imgRef}
useMap='#map'
src={img}
alt='MDN infographic resize'
style={{ width: 200, height: 100 }}
/>
</div>
)
}
<Area shape='circle'/>
Correct works only with saving original aspect ratio
GNU GENERAL PUBLIC LICENSE © dergunovd