问题描述:

I have a folder structure like in my Reactjs app:

rootFolder

-folder1

-file1

-folder2

-file2

-folder3

-folder4

-folder5

-file5

Here In file5 I want to import class from file1.

Lets say file1 has class Class1

I want to import it like:

import Class1 from ..../folder1/file1

but it is not being imported. Its giving me import error

What is wrong in here ??

网友答案:

You have typo. Instead of import Class1 from '..../folder1/file1' should be import Class1 from '../../../folder1/file1'

../ means that you go to one folder above.

Hope it will help you

相关阅读:
Top