All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.dist.core.index.d.ts Maven / Gradle / Ivy

The newest version!
import { Key, SWRConfiguration, FullConfiguration, SWRHook } from 'swr/_internal';
export { Arguments, BareFetcher, Cache, Fetcher, Key, KeyLoader, KeyedMutator, Middleware, MutatorCallback, MutatorOptions, Revalidator, RevalidatorOptions, SWRConfiguration, SWRHook, SWRResponse, State, mutate, preload, useSWRConfig } from 'swr/_internal';
import ReactExports from 'react';

declare const unstable_serialize: (key: Key) => string;

declare const SWRConfig: ReactExports.FC SWRConfiguration) | undefined;
}>> & {
    defaultValue: FullConfiguration;
};

/**
 * A hook to fetch data.
 *
 * @link https://swr.vercel.app
 * @example
 * ```jsx
 * import useSWR from 'swr'
 * function Profile() {
 *   const { data, error, isLoading } = useSWR('/api/user', fetcher)
 *   if (error) return 
failed to load
* if (isLoading) return
loading...
* return
hello {data.name}!
* } * ``` */ declare const useSWR: SWRHook; export { SWRConfig, useSWR as default, unstable_serialize };




© 2015 - 2024 Weber Informatics LLC | Privacy Policy