# `useAsyncRetry` Uses `useAsync` with an additional `retry` method to easily retry/refresh the async function; ## Usage ```jsx import {useAsyncRetry} from 'react-use'; const Demo = ({url}) => { const state = useAsyncRetry(async () => { const response = await fetch(url); const result = await response.text(); return result; }, [url]); return (
{state.loading ?
Loading...
: state.error ?
Error: {state.error.message}
:
Value: {state.value}
} {!loading && }
); }; ``` ## Reference ```ts useAsyncRetry(fn, args?: any[]); ```