If you want to get the device’s ip on React Native? Use the ReactNative library for getting information about the devices network:
react-native-network-info Example:
1 2 3 4 5 6 7 | // require module var NetworkInfo = require('react-native-network-info'); // Get Local IP NetworkInfo.getIPAddress(ip => { console.log(ip); }); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.