Merge pull request #178 from caljrimmer/next

Added Props store option to createDevTools.js
This commit is contained in:
Dan Abramov 2015-10-31 23:20:53 +03:00
commit 1752cccd82

View File

@ -13,14 +13,22 @@ export default function createDevTools(children) {
return class DevTools extends Component { return class DevTools extends Component {
static contextTypes = { static contextTypes = {
store: PropTypes.object.isRequired store: PropTypes.object
};
static propTypes = {
store: PropTypes.object
}; };
static instrument = () => enhancer; static instrument = () => enhancer;
constructor(props, context) { constructor(props, context) {
super(props, context); super(props, context);
if (context.store) {
this.liftedStore = context.store.liftedStore; this.liftedStore = context.store.liftedStore;
} else {
this.liftedStore = props.store.liftedStore;
}
} }
render() { render() {