0

I have the following:

SomeDirectory/index.js

import Foo from './foo';
import Bar from './bar';
import Baz from './baz';

export default {
  Foo,
  Bar,
  Baz,
};

And in my file, I want to just import like this:

SomeFile.js

import { Foo, Bar, Baz } from './SomeDirectory'

And then be able to use Foo, Bar, or Baz as is but instead I have to do:

import Container from './SomeDirectory'

and use it with Container.Foo

stackjlei
  • 9,485
  • 18
  • 65
  • 113
  • 1
    Just remove default in the index.js file and it should work – P-A Aug 16 '17 at 16:58
  • Possible duplicate of [ES6 Destructuring and Module imports](https://stackoverflow.com/questions/33524696/es6-destructuring-and-module-imports) – yuriy636 Aug 16 '17 at 16:59

0 Answers0