-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(i18n): init method returns a promise
before start, the app has to start all is ready
- Loading branch information
Francisco Moreno Cantero
committed
Jun 5, 2020
1 parent
8cc5a42
commit 92841f4
Showing
2 changed files
with
19 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import App from './App'; | ||
import './i18n'; | ||
import i18n from './i18n'; | ||
|
||
ReactDOM.render( | ||
<App />, | ||
document.getElementById('app'), // eslint-disable-line no-undef | ||
); | ||
i18n | ||
.init({ | ||
lng: 'es', | ||
fallbackLng: 'en', | ||
debug: process.env.NODE_ENV === 'development', | ||
interpolation: { | ||
escapeValue: false, // not needed for react as it escapes by default | ||
}, | ||
initImmediate: false | ||
}) | ||
.then(() => { | ||
ReactDOM.render( | ||
<App />, | ||
document.getElementById('app'), // eslint-disable-line no-undef | ||
); | ||
|
||
module.hot.accept(); | ||
module.hot.accept(); | ||
}); |