Closed rezzak-allcode closed 1 week ago
tried to reproduce this issue on my end but it works fine
kindly provide more context to this or better still you can check if your isLoading
state is set to a boolean as the loading prop takes a true, false and an undefined value
Hope this helps
@rezzak-allcode here is an example of controlling the loading state of the button using the react useState
hook.
import { useState } from "react";
import { Button } from "@material-tailwind/react";
export function ButtonDefault() {
const [isLoading, setIsLoading] = useState(false);
return (
<Button onClick={() => setIsLoading((cur) => true)} loading={isLoading}>
Button
</Button>
);
}
` <Button id="primary-btn" className="w-1/2" onClick={() => setOpen(false)} loading={isLoading}