Reverse Geocoding in React and React Native

The OneMap official documentation show us how to do reverse geocoding with AJAX calls.

However, it is not so straight forward in React/React Native. To perform AJAX call in, we are required to install AJAX library such as Axios and jQuery AJAX. Alternatively, we could use the fetch() function which is built into the browser!

Fetch() is more straight-forward and doesn’t require further installation. Please find the code in the article below.

Link to article

Hello, thanks for contributing this. By the way, you are using the Search API endpoint for this article. Reverse Geocoding means using coordinates (lat and lon) into full address which will need an API account.