doubts about navigation

2

I created an RN project and inside it I created a folder called screens .

Inside the screens folder I've created the app.js and home.js

in index.android.js I just gave a: import App from './screens/app';

In app.js I'm using the stackNavigator and gave a import Home from './home'

In home.js I used: import App from './App'

When running, you get an error that can not resolve the App module, in home.js.

I'm kind of lost in organizing the project into folders and importing and navigating between folders.

    
asked by anonymous 12.08.2017 / 20:41

2 answers

0

Post photo of your code so that the understanding of the problem is clear.

On the navigation with the StackNavigator, I leave an example in my github where I use this module objectively.

Link: GitHub

I hope I have helped.

Att,

Júlio Falbo

    
22.08.2017 / 18:47
0

First, be careful about the way you are organizing your imports. When you import home into app and app into home , you're causing a #

Second, are you exporting anything in these files?

Remember that when using import algo from './arquivo' you need to make sure that this other file is exporting something. Example:

file1.js export default {}; - > file2.js import algo from './file1' ;

file1.js export { objeto1, objeto2 }; - > file2.js import { objeto1, objeto2 } from '.file1'

    
16.08.2017 / 05:43