React Hook for IP Geolocation using GeoJS.
▶︎ demo
Using yarn
:
yarn add use-ipcoords
Using npm
:
npm i use-ipcoords --save
import React from 'react';
import { useIpCoords } from 'use-ipcoords'
export const Example = () => {
const {
latitudeIp,
longitudeIp
} = useIpCoords();
return (
<div>
latitudeIp : {latitudeIp}<br />
longitudeIp : {longitudeIp}<br />
</div>
);
};
MIT © Gords