'How to get nearest location based on user location from array of lat, long: react, leaflet

I have a react app that shows bike stations. I want to display nearest stations on dashboard. Is there any easier way to do that with react ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source