Integration for konami-emoji-blast in React. ⚛️
⬆ ⬆ ⬇ ⬇ ⬅ ➡ ⬅ ➡ 🅱 🅰
First install the @konami-emoji-blast/react
package as a dependency:
npm i @konami-emoji-blast/react
The preferred usage for React is with a provided useKonamiEmojiBlast
hook:
import { useKonamiEmojiBlast } from "konami-emoji-blast/react";
export function MyComponent() {
useKonamiEmojiBlast();
return <main>Hello, world!</main>;
}
Then, pressing the Konami Code on your React app should trigger fireworks blasts of emoji on the page. Yay! 🎆
If you can't use hooks, a KonamiEmojiBlast
component is provided too:
import { KonamiEmojiBlast } from "konami-emoji-blast/react";
export function MyComponent() {
return (
<main>
<KonamiEmojiBlast />
Hello, world!
</main>
);
}
💡 Tip: the class component just calls the hook internally.
@konami-emoji-blast/react
is managed as part of the emoji-blast monorepo.
See the monorepo's development docs first, then ./.github/DEVELOPMENT.md
.
💙 This package was templated with
create-typescript-app
.