Skip to content

Commit

Permalink
fix(router): app crash on lang change
Browse files Browse the repository at this point in the history
  • Loading branch information
Philip London committed Jun 12, 2020
1 parent dda813e commit 20500a1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
9 changes: 6 additions & 3 deletions packages/blockchain-wallet-v4-frontend/src/index.dev.js
@@ -1,4 +1,5 @@
import { AppContainer } from 'react-hot-loader'
import { BrowserRouter } from 'react-router-dom'
import React from 'react'
import ReactDOM from 'react-dom'

Expand All @@ -10,9 +11,11 @@ import Error from './index.error'
const renderApp = (Component, store, history, persistor) => {
const render = (Component, store, history, persistor) => {
ReactDOM.render(
<AppContainer key={Math.random()} warnings={false}>
<Component store={store} history={history} persistor={persistor} />
</AppContainer>,
<BrowserRouter>
<AppContainer key={Math.random()} warnings={false}>
<Component store={store} history={history} persistor={persistor} />
</AppContainer>
</BrowserRouter>,
document.getElementById('app')
)
}
Expand Down
5 changes: 4 additions & 1 deletion packages/blockchain-wallet-v4-frontend/src/index.prod.js
@@ -1,3 +1,4 @@
import { BrowserRouter } from 'react-router-dom'
import React from 'react'
import ReactDOM from 'react-dom'

Expand All @@ -8,7 +9,9 @@ import Error from './index.error'

const renderApp = (Component, store, history, persistor) => {
ReactDOM.render(
<Component store={store} history={history} persistor={persistor} />,
<BrowserRouter>
<Component store={store} history={history} persistor={persistor} />
</BrowserRouter>,
document.getElementById('app')
)
}
Expand Down

0 comments on commit 20500a1

Please sign in to comment.