Cannot import objects from the current folder into another folder
P粉434996845
P粉434996845 2024-04-04 15:43:37
0
1
490

I'm trying to import a file from another folder But getting this error

./src/components/Body/index.js
Module not found: Can't resolve '../../context' in '/home/workspace/reactjs/coding-practices/layoutBuilder/src/components/Body'

I've tried:

import ConfigurationContext from '../../context'
 import ConfigurationContext from './../context'

I want to import objects from context>ConfigurationContext.js in Body>index.js

Please help to solve this problem

P粉434996845
P粉434996845

reply all(1)
P粉551084295

Try this

import ConfigurationContext from './../../context/ConfigurationContext'

Because you didn't mention the file name in the path.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template