Skip to content

Instantly share code, notes, and snippets.

@marr
Created February 13, 2016 19:42
Show Gist options
  • Save marr/36cdbe52acd38de9045e to your computer and use it in GitHub Desktop.
Save marr/36cdbe52acd38de9045e to your computer and use it in GitHub Desktop.
React router with simple redux props
// imports go here...
// Assume prop{1,2} are sent in via props. I use react-router-redux for this.
const Page = ({ children, prop1, prop2 }) => (
<div>
<Menu />
<Content { prop1, prop2 }>
{children}
</Content>
</div>
)
// Routes (Provider comes from react-router-redux).
<Provider { store }>
<Router { history }>
<Route path="/" component={Page}>
<Route path="foo" component={Foo} />
<Route path="bar" component={Bar} />
</Route>
</Router>
</Provider>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment