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 state = useGameStore((s) => s.state);
|
||||||
const clickGain = getClickGain(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 createParticle = useCallback((clientX, clientY) => {
|
||||||
const particle = document.createElement("span");
|
const particle = document.createElement("span");
|
||||||
particle.className = "click-particle";
|
particle.className = "click-particle";
|
||||||
@@ -120,6 +110,16 @@ export default function Home() {
|
|||||||
return () => rain.stop();
|
return () => rain.stop();
|
||||||
}, [toggleRain]);
|
}, [toggleRain]);
|
||||||
|
|
||||||
|
if (!ready) {
|
||||||
|
return (
|
||||||
|
<section className="game-container">
|
||||||
|
<p style={{ textAlign: "center", color: "#6b7a99", marginTop: "20vh" }}>
|
||||||
|
Chargement de ta progression...
|
||||||
|
</p>
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<main className="zone" data-zone="swamp">
|
<main className="zone" data-zone="swamp">
|
||||||
<Helmet>
|
<Helmet>
|
||||||
|
|||||||
Reference in New Issue
Block a user