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

[v2] Update redux example #5713

Merged
merged 3 commits into from
Jun 6, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion examples/using-redux/gatsby-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Provider } from 'react-redux'

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

exports.replaceRouterComponent = ({ history }) => {
export const replaceRouterComponent = ({ history }) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you make this change to gatsby-ssr.js also? Currently gatsby build fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file use es6 import, so I use es6 export.
I fixed gatsby build.

const store = createStore()

const ConnectedRouterWrapper = ({ children }) => (
Expand Down
3 changes: 1 addition & 2 deletions examples/using-redux/gatsby-ssr.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { renderToString } from 'react-dom/server'

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

exports.replaceRenderer = ({ bodyComponent, replaceBodyHTMLString }) => {

export const replaceRenderer = ({ bodyComponent, replaceBodyHTMLString }) => {
const store = createStore()

const ConnectedBody = () => (
Expand Down
6 changes: 4 additions & 2 deletions examples/using-redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"version": "1.0.0",
"author": "Scotty Eckenthal <scott.eckenthal@gmail.com>",
"dependencies": {
"gatsby": "latest",
"gatsby": "next",
"react": "^16.4.0",
"react-dom": "^16.4.0",
"react-redux": "5.0.5",
"redux": "3.6.0"
},
Expand All @@ -19,4 +21,4 @@
"build": "gatsby build",
"serve": "gatsby serve"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class DefaultLayout extends React.Component {
<Link to="/c/">c</Link>
</li>
</ul>
{this.props.children()}
{this.props.children}
</div>
)
}
Expand Down
44 changes: 0 additions & 44 deletions examples/using-redux/src/html.js

This file was deleted.

7 changes: 6 additions & 1 deletion examples/using-redux/src/pages/a.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import React from "react"
import Layout from "../components/layout"

const A = () => <p>A</p>
const A = () => (
<Layout>
<p>A</p>
</Layout>
)

export default A
7 changes: 6 additions & 1 deletion examples/using-redux/src/pages/b.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import React from "react"
import Layout from "../components/layout"

const B = () => <p>B</p>
const B = () => (
<Layout>
<p>B</p>
</Layout>
)

export default B
7 changes: 6 additions & 1 deletion examples/using-redux/src/pages/c.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import React from "react"
import Layout from "../components/layout"

const C = () => <p>C</p>
const C = () => (
<Layout>
<p>C</p>
</Layout>
)

export default C
7 changes: 6 additions & 1 deletion examples/using-redux/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import React from "react"
import Layout from "../components/layout"

const Home = () => <p>Home</p>
const Home = () => (
<Layout>
<p>Home</p>
</Layout>
)

export default Home