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
try {
const msgFormatter = new IntlMessageFormat(msg, currentLocale, formats);
return msgFormatter.format(variables);
} catch (err) {
this.options.warningHandler(
`react-intl-universal format message failed for key='${key}'.`,
err.message
);
return msg;
}
No matter whether the get method passes variables or not, it will always take the IntlMessageFormat method. I don't think this is necessary. If there is no variables parameter, it can return msg directly, IntlMessageFormat will cause additional performance consumption.
If you don't pass variables, I think you can return msg directly, for example:
if (variables) {
...
+ } else {
+ return msg;
}
try {
const msgFormatter = new IntlMessageFormat(msg, currentLocale, formats);
return msgFormatter.format(variables);
} catch (err) {
this.options.warningHandler(
`react-intl-universal format message failed for key='${key}'.`,
err.message
);
return msg;
}
The text was updated successfully, but these errors were encountered:
In the actual project has encountered serious performance problems, currently using patch-package to hit patch to solve, It would be great if we could merge pr.
No matter whether the get method passes variables or not, it will always take the IntlMessageFormat method. I don't think this is necessary. If there is no variables parameter, it can return msg directly, IntlMessageFormat will cause additional performance consumption.
If you don't pass variables, I think you can return msg directly, for example:
The text was updated successfully, but these errors were encountered: