There is a line in my project code that goes like this,
const variableName = { ... }
export default variableName
Is the variableName
written correctly in the first place? Shouldn't its be either a
export const variableName = { ... } // import { variableName } from './file'
OR
export default variableName = { ... } // import variableName from './file'
What is the right way to import this in another file?
import { variableName } from 'file'
OR
import variableName from './file'
PS - I've looked at other answers, blogs as well but they do not talk about exporting a const variable as a default.