Search code examples
react-nativeexpo

How to add add new packages in expo snack?


I want to use expo-av package in expo snack. However I know that after importing expo-av at App.js file. I have to add the expo-av at package.json file.

enter image description here

But I want to use packages like this one, in the App.js file without manually typing the version on package.json file.

Is there any way to add packages in expo snack automatically after import? If I am missing this feature please let me know.


Solution

  • enter image description here

    Simply import the package in your js file and you will see a propmt asking you to install the dependency. Click on the Add dependency link and it will automatically add the package to your package.json.

    You can read more about this at Expo Snack Documentation