We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果intl.init 和intl.get不是放在一个调用栈里执行,即A用户的intl.init和intl.get之间插入了B用户的intl.init操作,会造成A用户的intl.get获取的是B用户设置的语言,如何处理这种情况
The text was updated successfully, but these errors were encountered:
创建多个实例,类似于 const map: Record<string, typeof intl> = {} export const getIntl = (componentName: string): typeof intl => { // 有些组件没调getIntl,会出现自身的国际化文案无用的问题,需要新建个国际化对象 if (map[componentName] && componentName !== '') return map[componentName]; if (componentName === '') return new (_intl as any).ReactIntlUniversal(); map[componentName] = new (_intl as any).ReactIntlUniversal(); return map[componentName]; }
const defaultIntl = getIntl('_');
Sorry, something went wrong.
No branches or pull requests
如果intl.init 和intl.get不是放在一个调用栈里执行,即A用户的intl.init和intl.get之间插入了B用户的intl.init操作,会造成A用户的intl.get获取的是B用户设置的语言,如何处理这种情况
The text was updated successfully, but these errors were encountered: