mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-02-27 08:50:37 +03:00
Change
This commit is contained in:
parent
7160bab14b
commit
0294e0ae2a
|
@ -1,21 +1,21 @@
|
||||||
import React, { Children, Component } from 'react';
|
import React, { Children, Component } from "react";
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from "prop-types";
|
||||||
import { connect, Provider, ReactReduxContext } from 'react-redux';
|
import { connect, Provider, ReactReduxContext } from "react-redux";
|
||||||
import instrument from 'redux-devtools-instrument';
|
import instrument from "redux-devtools-instrument";
|
||||||
|
|
||||||
function logError(type) {
|
function logError(type) {
|
||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
if (type === 'NoStore') {
|
if (type === "NoStore") {
|
||||||
console.error(
|
console.error(
|
||||||
'Redux DevTools could not render. You must pass the Redux store ' +
|
"Redux DevTools could not render. You must pass the Redux store " +
|
||||||
'to <DevTools> either as a "store" prop or by wrapping it in a ' +
|
'to <DevTools> either as a "store" prop or by wrapping it in a ' +
|
||||||
'<Provider store={store}>.'
|
"<Provider store={store}>."
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
console.error(
|
console.error(
|
||||||
'Redux DevTools could not render. Did you forget to include ' +
|
"Redux DevTools could not render. Did you forget to include " +
|
||||||
'DevTools.instrument() in your store enhancer chain before ' +
|
"DevTools.instrument() in your store enhancer chain before " +
|
||||||
'using createStore()?'
|
"using createStore()?"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
/* eslint-enable no-console */
|
/* eslint-enable no-console */
|
||||||
|
@ -47,13 +47,13 @@ export default function createDevTools(children) {
|
||||||
|
|
||||||
if (ReactReduxContext) {
|
if (ReactReduxContext) {
|
||||||
if (this.props.store && !this.props.store.liftedStore) {
|
if (this.props.store && !this.props.store.liftedStore) {
|
||||||
logError('NoLiftedStore');
|
logError("NoLiftedStore");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!props.store && !context.store) {
|
if (!props.store && !context.store) {
|
||||||
logError('NoStore');
|
logError("NoStore");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ export default function createDevTools(children) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.liftedStore) {
|
if (!this.liftedStore) {
|
||||||
logError('NoLiftedStore');
|
logError("NoLiftedStore");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,11 +85,11 @@ export default function createDevTools(children) {
|
||||||
<ReactReduxContext.Consumer>
|
<ReactReduxContext.Consumer>
|
||||||
{props => {
|
{props => {
|
||||||
if (!props || !props.store) {
|
if (!props || !props.store) {
|
||||||
logError('NoStore');
|
logError("NoStore");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (!props.store.liftedStore) {
|
if (!props.store.liftedStore) {
|
||||||
logError('NoLiftedStore');
|
logError("NoLiftedStore");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
|
Loading…
Reference in New Issue
Block a user