From d913b6a8a50d35b4c91803157c029649f839c2d8 Mon Sep 17 00:00:00 2001 From: AlanWen2016 <2276326604@qq.com> Date: Thu, 25 Aug 2022 14:49:06 +0800 Subject: [PATCH] Update API.md Update API.md --- website/docs/API.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/API.md b/website/docs/API.md index dbb20559a..f297591fe 100644 --- a/website/docs/API.md +++ b/website/docs/API.md @@ -561,7 +561,7 @@ it('should increment count', () => { expect(result.current.count).toBe(0); act(() => { // Note that you should wrap the calls to functions your hook returns with `act` if they trigger an update of your hook's state to ensure pending useEffects are run before your next assertion. - result.increment(); + result.current.increment(); }); expect(result.current.count).toBe(1); }); @@ -648,7 +648,7 @@ it('should increment count', () => { expect(result.current.count).toBe(1); act(() => { - result.increment(); + result.current.increment(); }); expect(result.current.count).toBe(2);