({
children,
...rest
}: ComponentProps<"button">)
| 3 | import { useFormStatus } from "react-dom"; |
| 4 | |
| 5 | export default function LoadingButton({ |
| 6 | children, |
| 7 | ...rest |
| 8 | }: ComponentProps<"button">) { |
| 9 | const { pending } = useFormStatus(); |
| 10 | |
| 11 | return ( |
| 12 | <button {...rest} disabled={pending || rest.disabled}> |
| 13 | <Spinner loading={pending}>{children}</Spinner> |
| 14 | </button> |
| 15 | ); |
| 16 | } |
nothing calls this directly
no outgoing calls
no test coverage detected