feat: performance optimization (#22810)
This commit is contained in:
parent
cf07189bd2
commit
a366de26c4
30 changed files with 138 additions and 83 deletions
|
|
@ -9,13 +9,15 @@ import { noop } from 'lodash-es'
|
|||
type II18NContext = {
|
||||
locale: Locale
|
||||
i18n: Record<string, any>
|
||||
setLocaleOnClient: (_lang: Locale, _reloadPage?: boolean) => void
|
||||
setLocaleOnClient: (_lang: Locale, _reloadPage?: boolean) => Promise<void>
|
||||
}
|
||||
|
||||
const I18NContext = createContext<II18NContext>({
|
||||
locale: 'en-US',
|
||||
i18n: {},
|
||||
setLocaleOnClient: noop,
|
||||
setLocaleOnClient: async (_lang: Locale, _reloadPage?: boolean) => {
|
||||
noop()
|
||||
},
|
||||
})
|
||||
|
||||
export const useI18N = () => useContext(I18NContext)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue