The syntax has witnessed a great change from ES5 to ES6. Important differences between the two releases of ECMAScript are:
Require vs. Import – The require used in ES5 is now replaced with import.var React = require(‘react’); //is now replaced with import React from ‘react’; //in ES6
Export vs. Exports – Instead of exports, now export is used.export default Component; // replaces module.exports = Component; // in ES6
Component and Function – The use of component and function has also changed from ES5 to ES6.
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.
We use cookies to ensure that we give you the best experience and use cookies in order to personalize the advertising that you see on our website. Read more about our Privacy Policy.Got it!