Created
August 13, 2018 00:33
-
-
Save kulakowka/d8136f99bad1879c4626ac78bb8d8721 to your computer and use it in GitHub Desktop.
react debug component
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
var devtools = /./; | |
devtools.toString = function() { | |
this.opened = true; | |
}; | |
console.log("%c", devtools); | |
// devtools.opened will become true if/when the console is opened | |
export default props => { | |
if (devtools.opened) { | |
return props.children; | |
} | |
return null; | |
}; |
Author
kulakowka
commented
Aug 13, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment