This repository has been archived by the owner on Jan 3, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Anthony Dugois
committed
Feb 22, 2016
1 parent
5060143
commit 222d93a
Showing
5 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import React from "react" | ||
import { render } from "react-dom" | ||
import { Provider } from "react-redux" | ||
import { Router, browserHistory } from "react-router" | ||
import Root from "Root" | ||
import store from "./store" | ||
import routes from "./routes" | ||
|
||
render( | ||
<Provider store={ store() }> | ||
<Root store={ store() }> | ||
<Router | ||
history={ browserHistory } | ||
routes={ routes } /> | ||
</Provider>, | ||
</Root>, | ||
document.querySelector("#root") | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React, { Component, PropTypes } from "react" | ||
import { Provider } from "react-redux" | ||
import DevTools from "DevTools" | ||
|
||
class Root extends Component { | ||
render() { | ||
return ( | ||
<Provider store={ this.props.store }> | ||
<div> | ||
{ this.props.children } | ||
<DevTools /> | ||
</div> | ||
</Provider> | ||
) | ||
} | ||
} | ||
|
||
Root.propTypes = { | ||
store: PropTypes.any, | ||
children: PropTypes.any, | ||
} | ||
|
||
export default Root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React, { Component, PropTypes } from "react" | ||
import { Provider } from "react-redux" | ||
|
||
class Root extends Component { | ||
render() { | ||
return ( | ||
<Provider store={ this.props.store }> | ||
{ this.props.children } | ||
</Provider> | ||
) | ||
} | ||
} | ||
|
||
Root.propTypes = { | ||
store: PropTypes.any, | ||
children: PropTypes.any, | ||
} | ||
|
||
export default Root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if (__PROD__) { | ||
module.exports = require("./Root.prod") | ||
} else { | ||
module.exports = require("./Root.dev") | ||
} |