Home > other >  How to start with ReactJS Project Do NOT HAVE App.js
How to start with ReactJS Project Do NOT HAVE App.js

Time:02-28

I have inherit a ReactJS project. There is strange that it does not have App.js file. How can I know where to start with project? I mean how can know where is the entry point of the project?

CodePudding user response:

In your "src" folder there would be "index.js" file, which render your main component in "public/index.html" root element. And other components can be added in index.js file.

Default index.js file:

  
 ​ReactDOM​.​render​( 
 ​  ​<React.StrictMode> 
 ​    ​<​App​ ​/​> 
 ​  ​</React.StrictMode>, 
 ​  ​document​.​getElementById​(​"root"​) 
 ​)​;

So, your entry component should be at ​"<​App​ ​/​>". In your app there is no App.js. So, Whichever component is there, that's your entry component.

CodePudding user response:

Go to index.html file in your project. There a component will be called after the header tag. Get the name of component and try to find the component in your project directory. The file name of component will most probably be Component.js

  • Related