user14856557
user14856557

Reputation:

expo-constants in react native how and where should i add it

Your project is accessing the following APIs from a deprecated global rather than a module import: Constants (expo-constants).

The global "__expo" and "Expo" objects will be removed in SDK 41. Learn more about how to fix this warning: https://expo.fyi/deprecated-globals

I don't know how to resolve this issue.

Upvotes: 1

Views: 8345

Answers (1)

Luka
Luka

Reputation: 1008

Step 1

expo install expo-constants

Step 2

Search your project for Constants string (exact match) and then import it with import Constants from 'expo-constants';. Also, remove any other Constants import that you might already have in that file.

If the problem still persist take a deeper look on Deprecated globals, maybe some of the packages you're using are not compatible version with your project's Expo SDK version.

Upvotes: 2

Related Questions