Is the Manifest in app.json loaded before the root App component is initialized?

I’m trying to read a config variable from app.json when initializing the root Component of my app (in App.js). The value is loaded in the constructor and used as a conditional check on whether to initialize a piece of middleware.

When I read it from Constants.manifest.extra, the value prints correctly, however the variable appears to be undefined at the time of checking the conditional in the constructor. (I tested this a number of ways)

When I hard code a global variable at the top of App.js, I get the behavior I expect.

I have no idea how to account for this except that maybe there’s a race condition between reading the manifest and construction of the root App component? Can anyone shed some light?

Thanks

Expo SDK v28.0.0 / XDE 2.24.4
Windows 10
react: 16.3.1
react-native: https://github.com/expo/react-native/archive/sdk-28.0.0.tar.gz

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.