I have an leaflet map where the users draw a polygon, and this polygon gave me lat and long points.
I'm using react js too.

i would like to know the polygon area so that i can take the id from the black dots that are within the polygon area. So the question is:
how do I remove the area of my polygon according to the information generated from it?

polygon draw function
if (type === 'Polygon') {
console.log(layer);
var geojson = layer.toGeoJSON();
console.log(geojson);
}
I'm assuming that finding the area of a polygon would resolve your problem. To find an area of the polygon, try using the shoelace algorithm. Learn more about how the algorithm works here