Wednesday, March 8, 2017

Import destructuring... ES6

In ES6 import, we need to be careful about a feature called destructuring.


import MyComp from './MyComp'

import {MyComp} from 'MyComp'

The results of these two statements are not the same.

The second example uses destructuring to extract MyComp from export.default object in MyComp.js.

The first example pulls the whole export.default object.


No comments:

Post a Comment

Ubuntu 12.04, 14.04, 16.04 - auto start an app or script before login

To run a command or application at startup, even before the user has logged in, you can use this file: /etc/rc.local The commands entered...