Download next.js/examples/cache-handler-redis/app/revalidate-from.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 507 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cache-handler-redis/app/revalidate-from.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/examples/cache-handler-redis/app/revalidate-from.tsx
-
curl -L -o revalidate-from.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cache-handler-redis/app/revalidate-from.tsx
507 Bytes
| "use client"; | |
| import { useFormStatus } from "react-dom"; | |
| import revalidate from "./server-actions"; | |
| function RevalidateButton() { | |
| const { pending } = useFormStatus(); | |
| return ( | |
| <button | |
| className="revalidate-from-button" | |
| type="submit" | |
| disabled={pending} | |
| aria-disabled={pending} | |
| > | |
| Revalidate | |
| </button> | |
| ); | |
| } | |
| export function RevalidateFrom() { | |
| return ( | |
| <form className="revalidate-from" action={revalidate}> | |
| <RevalidateButton /> | |
| </form> | |
| ); | |
| } | |