I have been trying to write constants in one file and using it on another file in ReactNative. But found that VSCode is not able to suggest the values of one hash object when importing with module.export = {}
structure, but it is working fine when I'm using export const ...
model. I totally got confused by this.
For eg:
// file one
const someObject = {
cValueOne: 1,
cValueTwo: 2
};
module.exports = {
someObject,
}
// file two
export const someObject = {
cValueOne: 1,
cValueTwo: 2
};
I can import both of them in another file as follows:
// usage file
import {
someObject,
} from '.../path/.../constants';
let a = someObject.cValueOne;
If I'm writing the file one modal export, then VSCode is not suggesting the values of someObject where if it is done as in file two, then VSCode is able to suggest it.
What could be the reason?