The use case is simple: I just want to export an object with the name just as it was imported.
for example:
import React from \'react\';
export React
Given ./foo.js
:
const Foo = class {
talk() { return 'hello'; }
};
export default Foo;
Then you should be able to do this:
import Foo from './foo';
let foo = new Foo();
foo.talk(); // => 'hello';
The syntax more or less follows the commonjs module.exports pattern, where you would do this:
const Foo = class {
};
module.exports = Foo;
More here:
http://exploringjs.com/es6/ch_modules.html