Skip to content

Commit

Permalink
Store should be initialized after useSSR
Browse files Browse the repository at this point in the history
If a the store is initialized with data from Server side rendering, it fire these warnings anyway:
`i18next was not initialized... This means something IS WRONG in your application setup.`
However, the application setup is fine, the warning is inconsistent.
I think this PR will do the trick: i18n should be considered as initialize once it receive initialI18nStore datas.
  • Loading branch information
fromi committed Nov 27, 2019
1 parent c909875 commit 6277ab8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/useSSR.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export function useSSR(initialI18nStore, initialLanguage, props = {}) {
if (initialI18nStore && !i18n.initializedStoreOnce) {
i18n.services.resourceStore.data = initialI18nStore;
i18n.initializedStoreOnce = true;
i18n.isInitialized = true;
}

if (initialLanguage && !i18n.initializedLanguageOnce) {
Expand Down

0 comments on commit 6277ab8

Please sign in to comment.