Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 823
Kamal Hossain Avatar asked Dec 06 '25 03:12

Kamal Hossain


2 Answers

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

like image 129
nithinpp Avatar answered Dec 08 '25 23:12

nithinpp


If anyone is still confused in 2024, you should add a package directly to the package.json file and just save that file. It will run npm install.

And there is a list of available packages that snack supports which is frequently updated. So not all packages are supported.

https://forums.expo.dev/t/modules-available-in-snack/1651

like image 22
Antonija Šimić Avatar answered Dec 09 '25 00:12

Antonija Šimić