Updates to our Learn ReactJS Courses

Good news! We’ve updated our Learn ReactJS: Part I and Learn ReactJS: Part II courses to use JavaScript ES6. ES6 (the sixth version of ECMAScript, which is the specification JavaScript is based on) introduces new syntax and additional functionality that makes the popular web language even more powerful than before.

Why? Since its release, JavaScript ES6 syntax has quickly become best practice and we believe it is important for anyone learning to code to get the most up-to-date education for what’s relevant in the industry today. Additionally, Facebook (creators of ReactJS) will be deprecating pre-ES6 syntax, which makes it even more important for everyone to learn ES6.

How does this impact you? If you’ve started any of our ReactJS courses, some of the code you wrote may now be invalid under the new syntax. Therefore, if you revisit any of the exercises that got updated, you’ll see the exercise code will have reset to show the new syntax. You can still navigate the course, but you’ll have to redo some exercises if you want to be able to run the code again.

If you don’t want to go back through the course to learn about the new syntax, we’ve outlined all the changes introduced below:

Syntax Changes to Learn ReactJS Courses

Learn ReactJS: Part I, JSX

  • Change var to let or const:

Change `var` to `let` or `const`

  • Change var React = require('react'); to import React from 'react';:

Change React require

  • Change var ReactDOM = require('react-dom'); to import ReactDOM from 'react-dom';

Change ReactDOM require

Learn ReactJS: Part I, React Components

Change class definition

  • Change class methods’ syntax to method shorthand, for instance:

Change class methods' syntax to method shorthand

Learn ReactJS: Part I, Components Interacting

  • Use export and export default to export each component instead of module.exports, for example:

Use `export` to export each component instead of `module.exports`

  • Change local file require statements to import statements, for example:

Change local file require statements to import statements

  • getDefaultProps() should be replaced with static defaultProps object property, for example:

`getDefaultProps()` should be replaced with static `defaultProps` object property

  • Replace getInitialState() with calling super() and setting state in constructor(), for example:

Replace `getInitialState()` with calling `super()` and setting `state` in `constructor()`

  • Bind methods in constructor to replace auto-binding:

Bind methods in `constructor` to replace auto-binding

Learn ReactJS: Part II, Advanced React (PropTypes)

  • propTypes instance property should be replaced with static property, for example:

`propTypes` instance property should be replaced with static property

Kathleen Houlihan is a leader in workforce innovation and she is the Founder of an agency that reimagines talent acquisition and optimizes the system for candidates and employers. Her company, Dream2Career, provides human-centric ROI solutions that filter-in candidates who exceed expectations in the workplace.

Get involved!

Engage in HIFies Community
Explore | Define | Grow


No comments yet