Wednesday, March 8, 2017

Import destructuring... ES6

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

Example:

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.

Details:

http://stackoverflow.com/questions/33524696/es6-destructuring-and-module-imports

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...