I'm encountering an issue in my application where I am trying to create an object to store key/value pairs for static texts and pass it to the initial state. However, I keep getting an error.
Here's a snippet from my helpers.js
file:
export const translation = Object.freeze({
edit: 'Edit',
please_select_text: 'Please select a row to edit',
done: 'Done',
role: 'Role',
});
Currently, I am importing this into my store module and passing it like this:
const defaultState = () => ({
localized: translation. // This is how I am passing it
});
In my component, I'm attempting to access this state as follows:
{{localized.edit}}
...mapState(module_name, ['localized']),
However, I keep receiving errors. Can you help me understand how to properly use these static texts in my application?