Wrap ES6 Module around React Component

Viewed 150

I am using react and ES6.

I have a file called:

mainComponent.js

To use this on other files I just import the component.

What I want to do now is to wrap the component(s) inside an ES6 Module so that I just need to use import on the module to have access to the component(s)

For example:

If I had 2 component:

reactComponent1.js
reactComponent2.js

Then I want to wrap these 2 components in wrapperModule.js

So that if I want to use these components I just import wrapperModule.js

Is this possible? If so how?

1 Answers
Related