fix: move hooks before ready guard — React rules of hooks
Some checks failed
CI/CD — Build & Deploy / Build & Deploy (push) Failing after 17s
Some checks failed
CI/CD — Build & Deploy / Build & Deploy (push) Failing after 17s
This commit is contained in:
@@ -22,16 +22,6 @@ export default function Home() {
|
||||
const state = useGameStore((s) => s.state);
|
||||
const clickGain = getClickGain(state);
|
||||
|
||||
if (!ready) {
|
||||
return (
|
||||
<section className="game-container">
|
||||
<p style={{ textAlign: "center", color: "#6b7a99", marginTop: "20vh" }}>
|
||||
Chargement de ta progression...
|
||||
</p>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
const createParticle = useCallback((clientX, clientY) => {
|
||||
const particle = document.createElement("span");
|
||||
particle.className = "click-particle";
|
||||
@@ -120,6 +110,16 @@ export default function Home() {
|
||||
return () => rain.stop();
|
||||
}, [toggleRain]);
|
||||
|
||||
if (!ready) {
|
||||
return (
|
||||
<section className="game-container">
|
||||
<p style={{ textAlign: "center", color: "#6b7a99", marginTop: "20vh" }}>
|
||||
Chargement de ta progression...
|
||||
</p>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<main className="zone" data-zone="swamp">
|
||||
<Helmet>
|
||||
|
||||
Reference in New Issue
Block a user