Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

get ip add in react

install axios
const [ip, setIP] = useState('');
const getData = async () => {
  const res = await axios.get('https://geolocation-db.com/json/')
  console.log(res.data);
  setIP(res.data.IPv4)
}
useEffect( () => {
  getData()
}, [])

More Help submit a request at.
bilalahmed-dev.azeemlab.com
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #ip #add #react
ADD COMMENT
Topic
Name
9+9 =