0
votes

I'm having a error once import a component, react native says me that the file path is wrong, but it's not! My main component where I'm trying to import a component and my file structure:

enter image description here

I'm on pages/Main/index and wanna import a file from components/Header/index, I'm sure about the path, I'm I think this is because of some react native project config, something like this

(I'm a windwos user and tryed to use /index in the path too)

The error: enter image description here

2

2 Answers

0
votes

Try passing '../components/Header'

Please let me know if it works. Thanks

0
votes

Your .'./components/Header' path is right.. In your Header component folder there is no any styles.js but you are importing in index.js which is in Header folder.. The above error is regarding path to styles.js in header folders Index.js Read the error carefully. They have mentioned original Path and target path. Hope you get it.