Entry point at main.js

The client/main.js file in the client folder will be the entry point to render the complete React app. In this code, we import the root or top-level React component that will contain the complete frontend and render it to the div element with the ID 'root' specified in the HTML document in template.js.

mern-skeleton/client/main.js:

import React from 'react'import { render } from 'react-dom'import App from './App'render(<App/>, document.getElementById('root'))

Get Full-Stack React Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.