Answer the question
In order to leave comments, you need to log in
How to make such import of files?
I want to import locales like this:
import { en, ru } from 'public/locales';
what is the right way to do this?
now I have the following structure (example for 'en')
public/locales/en.js
внутри en.js:
export const main = {...}
export const nav = {...}
export const footer = {...}
...
Answer the question
In order to leave comments, you need to log in
1. Create index.js in public/locales
2. In index.js import the required locales
import en from 'path/to/en';
import ru from 'path/to/ru';
export {
en,
ru,
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question