Skip to content

Commit

Permalink
fix: dot not get initial value in effect
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Jan 26, 2024
1 parent 7a1a6cf commit da418bb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/GZCTF/ClientApp/src/utils/I18n.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ export const useLanguage = () => {
const [language, setLanguageInner] = useLocalStorage({
key: 'language',
defaultValue: 'zh_CN',
getInitialValueInEffect: false
})

const { i18n } = useTranslation()

useEffect(() => {
console.log(`Switching language to ${language}`)
i18n.changeLanguage(language)
}, [language])

Expand Down

0 comments on commit da418bb

Please sign in to comment.