Hi, thanks for sharing, really helped me a lot. Though I have a question, is it a mistake on my part when I got an error trying to make the App.js in the src file instead of the components file?
You can place App.js in either src folder or components folder. It's your choice. The only thing you need to change is to update the import path of App.js inside the AppRouter.js file to import App from '../App'; and inside the AppRouter.js file change import { API_URL } from '../utils/constants'; to import { API_URL } from './utils/constants'; assuming you have placed App.js inside the src folder.
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi, thanks for sharing, really helped me a lot. Though I have a question, is it a mistake on my part when I got an error trying to make the
App.jsin thesrcfile instead of thecomponentsfile?You can place
App.jsin eithersrcfolder orcomponentsfolder. It's your choice. The only thing you need to change is to update the import path ofApp.jsinside theAppRouter.jsfile toimport App from '../App';and inside theAppRouter.jsfile changeimport { API_URL } from '../utils/constants';toimport { API_URL } from './utils/constants';assuming you have placedApp.jsinside thesrcfolder.