Skip to content

Commit

Permalink
Fix for console redux-devtools warnings
Browse files Browse the repository at this point in the history
reduxjs/redux-devtools#127
(temporarily install patched redux-devtools until 0.14 is officially released)

Add repo field to package.json to silence npm warning

Document the need to allow popups for `npm run dev:nw` #110

Use https:// rather than ssh:// for temporary redux-devtools patch
also, specify the only change necessary to fix console warnings
tomatau/redux-devtools@d77ef99

Update monkey-patched redux-devtools to include built files

Wait for the redux-devtools window to finish reloading before inserting our target node
  • Loading branch information
leonhiat committed Oct 2, 2015
1 parent c3299b1 commit 061790a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Runs the webpack build system just like in `compile` but enables HMR. The webpac
#### `npm run dev:nw`
Same as `npm run dev` but opens the debug tools in a new window.

**Note:** you'll need to allow popups in Chrome, or you'll see an error: [issue 110](https://github.com/davezuko/react-redux-starter-kit/issues/110)

#### `npm run dev:no-debug`
Same as `npm run dev` but disables devtools.

Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
"test:dev": "npm run test -- --watch",
"deploy": "npm run test && npm run compile"
},
"repository": {
"type": "git",
"url": "git+https://github.com/davezuko/react-redux-starter-kit.git"
},
"author": "David Zukowski <david@zuko.me> (http://zuko.me)",
"license": "MIT",
"dependencies": {
Expand Down Expand Up @@ -58,7 +62,7 @@
"react-transform-catch-errors": "^0.1.2",
"react-transform-hmr": "^1.0.0",
"redbox-react": "^1.0.4",
"redux-devtools": "^2.1.2",
"redux-devtools": "tomatau/redux-devtools#e126f799bb81a61e4a2ce69fbc501e09b15b5f5d",
"sass-loader": "^2.0.0",
"style-loader": "^0.12.1",
"webpack": "^1.11.0",
Expand Down
11 changes: 8 additions & 3 deletions src/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react';

export function createConstants (...constants) {
Expand Down Expand Up @@ -28,10 +29,14 @@ export function createDevToolsWindow (store) {

// wait a little bit for it to reload, then render
setTimeout(() => {
React.render(
<DebugPanel top right bottom left >
// Wait for the reload to prevent:
// "Uncaught Error: Invariant Violation: _registerComponent(...): Target container is not a DOM element."
win.document.write('<div id="react-devtools-root"></div>');

ReactDOM.render(
<DebugPanel top right bottom left key="debugPanel" >
<DevTools store={store} monitor={LogMonitor} />
</DebugPanel>
, win.document.body);
, win.document.getElementById('react-devtools-root'));
}, 10);
}

0 comments on commit 061790a

Please sign in to comment.