git ssb

1+

dinoworm ๐Ÿ› / catstack



Commit 73b8cb0026f46f9832397193b25b38399404be17

fix app/utils/fetch-element

Michael Williams committed on 1/8/2016, 5:33:25 AM
Parent: 9a58b75ae70cb562daad4d67cfa777ae8aa48459

Files changed

app/render-browser.jschanged
app/util/fetch-element.jschanged
app/render-browser.jsView
@@ -18,9 +18,9 @@
1818
1919 syncReduxAndRouter(history, store)
2020
2121 const main = (
22- <Router createElement={fetchElement} history={history}>
22+ <Router createElement={fetchElement(store)} history={history}>
2323 { routes }
2424 </Router>
2525 )
2626
app/util/fetch-element.jsView
@@ -1,12 +1,13 @@
11 import React from 'react'
22
3-export default function fetchElement (Component, props) {
4- if (Component.fetchData) {
5- Component.fetchData(
6- store.getState, store.dispatch,
7- props.location, props.params
8- )
3+export default function fetchElement (store) {
4+ return function (Component, props) {
5+ if (Component.fetchData) {
6+ Component.fetchData(
7+ store.getState, store.dispatch,
8+ props.location, props.params
9+ )
10+ }
11+ return React.createElement(Component, props)
912 }
10- return React.createElement(Component, props)
1113 }
12-

Built with git-ssb-web