DEV Community

Discussion on: Build File Upload/Download Functionality with Image Preview using MERN stack

Collapse
 
poly404 profile image
poly404

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?

Collapse
 
myogeshchavan97 profile image
Yogesh Chavan

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