-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Related to https://github.com/gtournie/redux-form-validators/blob/master/examples/src/index.js#L25.
I'm working with Redux-Saga and it watches for "CHANGE_LOCALE" action:
// saga
export function* changeLocaleSaga(action: routines.setLocaleAction) {
yield call(LocaleService.configureReduxFormValiators, action.payload);
}
yield all([
takeEvery(routines.CHANGE_LOCALE, changeLocaleSaga),
]);And in Locale Service I mutate the Validators:
// Locale.service
function configureReduxFormValiators(locale: ISupportedLocale) {
const messages = getTranslationsByLocale(locale);
Validators.messages = {
...Validators.messages,
email: messages['component.field.error.isNotValidEmail'],
};
}
export const LocaleService = {
// getTranslationsByLocale,
// getSupportedLocaleByLocale,
configureReduxFormValiators,
};BUT the problem here that Validators mutation doesn't tell React to re-render.
Please advice.
Metadata
Metadata
Assignees
Labels
No labels