Ramzan Chasygov Ramzan Chasygov - 1 month ago 10
React JSX Question

Adding locale.js in moment React

i wanna add

moment-locale-ru.js
in react, and i just add
moment-locale-ru.js
in
script tag
in
index.html
, but it requires
moment
, because
react
perform after
script tag
. How properly add
locale
in
moment
React
?

Answer Source

If you look at the github repo here, russian locale is already included and you can import it in your component like this:

import 'moment/locale/ru';