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
  • 12,209
  • 10
  • 24
  • 44
Mustehssun Iqbal
  • 576
  • 3
  • 19

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,996
  • 1
  • 10
  • 16