You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my typescript react project, I have integrated yup with react-intl so that error messages can be multiple languages. The way i have configured this is
setLocale({mixed: {required: ()=>({id: "validation.required"})},string: {email: ()=>({id: "validation.email"})},number: {positive: ()=>({id: "validation.positive"}),integer: ()=>({id: "validation.integer"}),min: ({ min })=>({id: "validation.min",values: {min: min}}),max: ({ max })=>({id: "validation.max",values: {max: max}}),lessThan: ({ less })=>({id: "validation.lessThan",values: {less: less}})}});
Because of this the error message message now actually is of the form {"id": "validation.positive" } but the following code fails to compile as the "msg" variable is of type "string"
In my typescript react project, I have integrated yup with react-intl so that error messages can be multiple languages. The way i have configured this is
Because of this the error message message now actually is of the form
{"id": "validation.positive" }
but the following code fails to compile as the "msg" variable is of type "string"My Ugly Temporary Fix
Your environment
The text was updated successfully, but these errors were encountered: