next-fetch
next-fetch copied to clipboard
feat: Conditional Fetching
Currently there is no declarative way to conditionally fetch data.
Future
This is how an implementation could look like following the swr convention.
import { useTestQuery } from "./api/test.swr";
export default function IndexPage({ id }) {
const testQuery = useTestQuery(id ? { id } : null);
return (
...
);
}