January 2019
Intermediate to advanced
460 pages
10h 33m
English
There are many best practices for React. The central philosophy behind it is to split up our code into separate components where possible. We are going to cover this approach in more detail later in Chapter 5, Reusable React Components.
Our index.js file is the main starting point of our front end code, and this is how it should stay. Do not include any business logic in this file. Instead, keep it as clean and slim as possible.
The index.js file should include this code:
import React from 'react';import ReactDOM from 'react-dom';import App from './App';ReactDOM.render(<App/>, document.getElementById('root'));
The release of ECMAScript 2015 introduced the import feature. We use it to require our npm packages, ...
Read now
Unlock full access