react-easter-egg
Installation
npm install react-easter-egg --save
Props
Key | Value | Default | Required | Description |
---|---|---|---|---|
callback | function | undefined | No | A callback triggered when the user has entered the code |
className | string | '' | No | A class to assign to the wrapper div when a child is specified |
disable | boolean | false | No | If set to true, the easter egg will be disabled |
code | array | Konami code | No | An array of integer representing the keyboard sequence to catch |
Usage
First you need to import the component :
;
Display sub component
<EasterEgg> <p>Text to display when the code is entered</p></EasterEgg>
Trigger callback
<EasterEgg callback= { ; } />
Examples
Material ui Dialog
;;; Component state = open: false ; { this; }; { this; }; { return <EasterEgg callback=thishandleOpen> <Dialog modal=false open=thisstateopen onRequestClose=thishandleClose> <iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameBorder="0" allowFullScreen></iframe> </Dialog> </EasterEgg> } ;
License
MIT