Update to SWR version 2.x (#296)

* Update SWR to version 2.1.5

* Improve generic type names

* Use "isLoading" property of "useSWR" response

* Correctly load library without selected tab

With the latest SWR version the library was empty on the first load.
Not sure what exactly is the reason, but due to "isPaused" the request wasn't sent even after "activeTab" wasn't undefined anymore.
Instead of using "isPaused", passing "null" as the key will also prevent SWR from doing the request.
This commit is contained in:
schroda
2023-05-15 11:56:55 +02:00
committed by GitHub
parent 4aff22079a
commit 8dae72604f
11 changed files with 34 additions and 35 deletions

View File

@@ -46,7 +46,7 @@
"react-router-dom": "^5.2.0",
"react-scripts": "^5.0.1",
"react-virtuoso": "^1.8.6",
"swr": "^1.3.0",
"swr": "^2.1.5",
"use-query-params": "^1.2.3",
"web-vitals": "^2.1.0"
},