Currently I am using translate function and i18n instance through useTranslation() hook.
Initialization within React component looks like this:
const { t, i18n } = useTranslation();
Which works well, but I would like to avoid both dispatching an action for changing language within Redux store and call i18n.changeLanguage(lang.code), every time user changes the language.
So I was wondering how can I change active i18n language from javascript function that is not a React component, because useTranslation() hook can only be used inside React component.