HomePhabricator
Diffusion Comm 966ee19f20ec

[native] Add 'natDevHostname' field to Expo config

Description

[native] Add 'natDevHostname' field to Expo config

Summary:

  • Created the app.config.js, which is a dynamic version of app.json - you can read more about them in the official guide. The file is evaluated when running yarn dev in native.
  • Added the natDevHostname field to the "extra" config
  • The field is supplied with local machine IP address

Depends on D6266

Test Plan:
Open native yarn dev and run app (either physical device or simulator).
The following should work:

// in native app (e.g. in `root.react.js`)
import Constants from 'expo-constants';
console.log(Constants.expoConfig.extra.natDevHostname);

Ensured it displays local LAN IP of my MacBook.

Reviewers: ashoat, atul

Reviewed By: ashoat

Subscribers: tomek

Differential Revision: https://phab.comm.dev/D6267

Details

Provenance
bartekAuthored on Jan 14 2023, 7:52 AM
Reviewer
ashoat
Differential Revision
D6267: [native] Add 'natDevHostname' field to Expo config
Parents
rCOMM60687af2d8e5: [native] Add 'internal-ip' dependency
Branches
Unknown
Tags
Unknown