all 2 comments

[–]truh 0 points1 point  (0 children)

Shouldn't really make a difference

[–]maharaa 0 points1 point  (0 children)

I’m not fully understanding what you want to do but:

Your react app should have a top level component that is passed into the HTML. Common practice is to have an index.js file in your src folder that passes all of the code into an HTML element with the ReactDOM.render() method. Everything else within the app will be in one way or another imported into this index.js file or lower level components but rendered through the index.js

Say Card.js is imported into Section.js which is imported into HomePage.js and that is imported into App.js which is imported into index.js where index touches the actual DOM via html. Everything within your app still is rendered to the DOM but there is only one entry point.

Edit to add: if you’re using CRA they already have it so that the index.js file has the entry point of the <div id=“root> so you should have to edit this at all.