I'm trying to change my circle Opacity when I click on it to act as an active state
I declared my state
const [active, setActive] = useState(false)
My function
const sidebarTrigger = () => {
setActive(true)
}
this is how i'm trying to change it, inside my MapContainer
fillOpacity= {active ? '0.9' : '0.7'}
MapContainer
<MapContainer whenCreated={setMap} center={[selectedRegion['lat'],selectedRegion['long']]} zoom={selectedRegion['zoom']} scrollWheelZoom={true}>
<TileLayer
url="https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
/>
{props.regionC.map((item,i) => {
<Circle
eventHandlers={{ click: sidebarTrigger.bind(this, item.city,item.lat,item.long) }}
center={item.city === 'Johannesburg' || item.city === 'Johhensburg' ? [-26.195246,28.034088] : [item.lat ,item.long]}
color= '#EE7E18'
fillColor="#EE7E18"
fillOpacity= {active ? '0.9' : '0.7'}
weight="0"
radius={radius}
/>
)
}
})}
</MapContainer>