I'm sharing the shortest part of my code:
const [oAuthsLoaded, setoAuthsLoaded] = useState<("google" | "discord")[]>(
[],
);
useEffect(() => {
console.log(oAuthsLoaded, oAuthsLoaded.length);
}, [oAuthsLoaded]);
<button
disabled={oAuthsLoaded.length > 0}
onClick={handleSignIn}
className="w-fit rounded-full bg-white p-1"
>
<Script
onLoad={() => setoAuthsLoaded(loaded => ([...loaded, "google"]))}
src="https://accounts.google.com/gsi/client"
async
defer
></Script>
I've used .length > 0 on purpose.
However, the disabled is not going away. What can I do to fix?