Check out example codes for "get ip". It will help you in understanding the concepts better.

Code Example 1

curl ipinfo.io

Code Example 2

#Windows (cmd)
ipconfig

Code Example 3

ipcongig

Code Example 4

shhh... That's a secret

Code Example 5

my ip address

Learn ReactJs, React Native from akashmittal.com