From 99725c2419e829e75c17e493f9db2efa3d4c9808 Mon Sep 17 00:00:00 2001 From: sAy <47605337+mingcenwei@users.noreply.github.com> Date: Sun, 22 Nov 2020 20:28:33 +0800 Subject: [PATCH] Fix README.md typo '/api/data' => '/api/user' in "Multiple Arguments" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d9b777c57..77c5685bb 100644 --- a/README.md +++ b/README.md @@ -273,7 +273,7 @@ In some scenarios, it's useful to pass multiple arguments (can be any value or o useSWR('/api/user', url => fetchWithToken(url, token)) ``` -This is **incorrect**. Because the identifier (also the index of the cache) of the data is `'/api/data'`, +This is **incorrect**. Because the identifier (also the index of the cache) of the data is `'/api/user'`, so even if `token` changes, SWR will still have the same key and return the wrong data. Instead, you can use an **array** as the `key` parameter, which contains multiple arguments of `fetcher`: