Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change using-redux example to not use replaceRouterComponent API #6986

Merged
merged 1 commit into from
Aug 6, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions examples/using-redux/gatsby-browser.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import React from 'react'
import { Router } from 'react-router-dom'
import { Provider } from 'react-redux'
import React from "react"
import { Provider } from "react-redux"

import createStore from './src/state/createStore'
import createStore from "./src/state/createStore"

const store = createStore()

export const replaceRouterComponent = ({ history }) => {
export const wrapRootComponent = ({ Root }) => {
const ConnectedRootComponent = () => (
<Provider store={store}>
<Root />
</Provider>
)

const ConnectedRouterWrapper = ({ children }) => (
<Provider store={store}>
<Router history={history}>{children}</Router>
</Provider>
)

return ConnectedRouterWrapper
return ConnectedRootComponent
}