Calling locally hosted server from Expo App

后端 未结 7 760
无人共我
无人共我 2020-12-08 20:26

I am creating a react-native app and one of the components I have created contains a property which is populated through data coming from an http request.

Right now

7条回答
  •  忘掉有多难
    2020-12-08 20:50

    import Constants from "expo-constants";
    
    const { manifest } = Constants;
    
    const uri = `http://${manifest.debuggerHost.split(':').shift()}:4000`;
    

提交回复
热议问题