How to create constants file like: key - value in ReactJs,
ACTION_INVALID = "This action is invalid!"
errorMsg = myConstClass.ACTION_INVALID;
You can simply create an object for your constants:
const myConstClass = {
ACTION_INVALID: "This action is invalid!"
}
And then use it.
If you are bundling, you can export
this object and then import
for each component file.