Forked from tlrobinson/redux-devtools-separate-window.js
Last active
August 26, 2015 09:43
-
-
Save Lendar/2c9aca52b6cb913a996d to your computer and use it in GitHub Desktop.
Put the awesome redux-devtools in it's own window so it doesn't obscure or be obscured by your application
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
import React from 'react' | |
import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react' | |
export default function openDebugPanel (store) { | |
const width = 0.3 * screen.width | |
const left = 0.7 * screen.width - 5 | |
const height = screen.height | |
const win = window.open( | |
null, | |
'redux-devtools', | |
`left=${left},width=${width},height=${height}, | |
menubar=no,location=no,resizable=yes,scrollbars=no,status=no`) | |
win.location.reload() | |
setTimeout(() => { | |
React.render( | |
<DebugPanel top right bottom left > | |
<DevTools store={store} monitor={LogMonitor} /> | |
</DebugPanel> | |
, win.document.body) | |
}, 10) | |
} | |
window.React = window.React || {} | |
window.React.Perf = window.React.Perf || require('react/lib/ReactDefaultPerf') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment