React
@konami-emoji-blast/react
provides a React component and hook.
These act as convenience wrappers around konami-emoji-blast
.
You can always call konami-emoji-blast
βs functions directly instead.
First install the @konami-emoji-blast/react
package as a dependency:
useKonamiEmojiBlast
The preferred usage for React is with a provided useKonamiEmojiBlast
hook.
Call it in a root-level component in your app to call initializeKonamiEmojiBlast
when the component is rendered.
Then, pressing the Konami Code on your React app should trigger fireworks blasts of emoji on the page. Yay! π
useKonamiEmojiBlast
Options
useKonamiEmojiBlast
may take a single optional parameter, onActivate
.
onActivate
A function to run whenever the user inputs the Konami Code.
KonamiEmojiBlast
If you canβt use hooks, a KonamiEmojiBlast
component is provided too: