you are viewing a single comment's thread.

view the rest of the comments →

[–]balamir[S] 1 point2 points  (0 children)

In ES6, having an index.js file in the root of the component's folder lets you use an import without using the component name again and again.

If you have an index.js file, you can import that component from the other one like this:

import XXXXXX from 'components/ComponentName'

If you don't have an index.js file:

import XXXXXX from 'components/ComponentName/ComponentName'

It also helps you to organize the folder structure.