Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native: Under what circumstances do you have to manually add dependencies of your dependencies?

I have the component react-native-modal-datetime-picker in my React Native project. It's throwing the following error:

error: bundling failed: Error: Unable to resolve module '@react-native-community/datetimepicker' from 'node_modules/react-native-modal-datetime-picker/src/DateTimePickerModal.android.js: @react-native-community/datetimepicker could not be found within the project.

It seems that there's a reference in the react-native-modal-datetime-picker module to the @react-native-community/datetimepicker module. I've never run into a scenario before where I had to manually add a dependency of another dependency. Does anyone have any insight on why this is happening?

like image 652
gkeenley Avatar asked Jan 17 '20 03:01

gkeenley


People also ask

What is dependency injection in react-native?

Dependency injection (DI) is a pattern where components necessary for your code to run are hot-swappable. This means that your dependencies are not hard-coded in your implementation and can change as your environment changes.


1 Answers

see the github

you need to run this:

expo install react-native-modal-datetime-picker @react-native-community/datetimepicker

like image 127
Nes Avatar answered Sep 20 '22 06:09

Nes