From 45559ffe782eb3012474a30e0b28f793b5ed1639 Mon Sep 17 00:00:00 2001 From: Louis-Marie Michelin Date: Thu, 15 Oct 2020 23:36:31 +0200 Subject: [PATCH] docs: Fix useAsyncFn example to avoid error --- docs/useAsyncFn.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/useAsyncFn.md b/docs/useAsyncFn.md index 94cc243e..bf86788d 100644 --- a/docs/useAsyncFn.md +++ b/docs/useAsyncFn.md @@ -9,7 +9,7 @@ function that returns a promise. The state is of the same shape as `useAsync`. import {useAsyncFn} from 'react-use'; const Demo = ({url}) => { - const [state, fetch] = useAsyncFn(async () => { + const [state, doFetch] = useAsyncFn(async () => { const response = await fetch(url); const result = await response.text(); return result @@ -23,7 +23,7 @@ const Demo = ({url}) => { ?
Error: {state.error.message}
:
Value: {state.value}
} - + ); };