How to use any React Native module in expo-dev-client?

Viewed 597

https://docs.expo.dev/clients/getting-started/#customizing-your-runtime gave 1 example of how to include the non-Expo module @react-native-voice/voice into an Expo project, but if I try to include another non-Expo module such as https://www.npmjs.com/package/react-native-device-info , then I ran expo run:android it errors with

Package "react-native-device-info" does not contain a valid config plugin. Learn more: https://docs.expo.dev/guides/config-plugins/#creating-a-plugin

. I am expecting some magic way to include non-Expo React Native modules into an Expo project using Custom Development Clients (https://blog.expo.dev/introducing-custom-development-clients-5a2c79a9ddf8), is my expectation wrong? What do I need to do?

1 Answers

You don't need to add every react native module to "plugins" field in your app.config. Most modules have auto linking enabled. Config plugins are just plugins which auto performs extra setup steps. You will get it working without extra configs.

react-native-device-info does not have a app.plugin.js in repo, which means it does not provide a config plugin. That's why you are getting this error.

Related