Calling locally hosted server from Expo App

后端 未结 7 761
无人共我
无人共我 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 21:02

    To add to Tadeusz's answer, in the current version of Expo (I'm on 32.0.0 right now), you would import Constants rather than Expo (even though the constants are referenced in the docs as Expo.Constants.manifest), so it would look like

    import { Constants } from 'expo';
    const { manifest } = Constants;
    

    Also, prepending the generated address with the protocol seems to be a must to make it all work.

提交回复
热议问题