In react, I have the following file: constants.js, containting
export const myConstant1 = 'abc';
export const myConstant2 = 'xyz';
export const myObject = {
myConstant1: 'This is the first constant', // myConstant1 here is NOT recognized
myConstant2: 'This is the second constant' // myConstant2 here is NOT recognized
}
My problem is, I cannot reference myConstant1
and myConstant2
from within myObject
. What am I missing?
Thanks.