0

I am new to React.js and am facing this error. A file in my project is exporting a function as follows:

exports.building = {
    //... //Something goes here...
};

And I am importing it as follows:

const building from "./building";

I have come across the following links but am unable to find a reasonable fix:

James Z
  • 11,838
  • 10
  • 25
  • 41
Mustehssun Iqbal
  • 486
  • 2
  • 15

1 Answers1

1

For export use:

export const building = {
  //Something goes here...
};

For import:

import { building } from "./building";

More about imports in ES6 here

Max
  • 1,418
  • 4
  • 13