Robert Bogos
Robert Bogos

Reputation: 53

Attempted import error in react app but the path and everything is correct

I am receiving the following error : Attempted import error: 'MyPropertiesForm' is not exported from '../../forms'. and I cannot figure out why because everything is correct.

Here is how I import import { MyPropertiesForm } from '../../forms';

// this file is in E:\falala\src\containers\MyPropertiesPage\MyPropertiesPage.js

And here is how I export

const MyPropertiesForm = compose(injectIntl)(MyPropertiesFormComponent);
MyPropertiesForm.displayName = 'ContactDetailsForm';
export default MyPropertiesForm;

//this file is in E:\falala\src\forms\MyPropertiesForm\MyPropertiesForm.js

Upvotes: 0

Views: 4040

Answers (1)

Eldshe
Eldshe

Reputation: 743

Try

import  MyPropertiesForm  from '../../forms/MyPropertiesForm/MyPropertiesForm';

Pay attention that the path you gave was only to the "form" folder but the export was actually in a file deep inside that folder.

And also pay attention that when you import a default exported module so you don't write it inside {} but write it as is named.

Upvotes: 1

Related Questions