HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
vercel
swr
TypeScript2019–2022
vercel / swr

swr

React Hooks for Data Fetching

4Distinct people
4Mentions
0Explicit recommenders
32.5KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

React Hooks for Data Fetching

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year4 dated mentions

Observed mentions: 2019-11-08 07:54:08 UTC to 2022-12-10 03:23:13 UTC.

012019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 1 mentions; 1 submissions, 0 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2022

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC110
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC101
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC101
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC101

What Hacker News says

4 sources
With `useSWR` the return type is export interface SWRResponse<Data = any, Error = any> { /** * The returned data of the fetcher function. */ data: Data | undefined /** * The error object thrown by the fetcher function. */ error: Error | undefined mutate: KeyedMutator<Data> isValidating: boolean isLoading: boolean } https://github.com/vercel/swr/blob/14956a840ac9b75fe321bf846... so if I check `isLoading` in my component then typescript isn't able to narrow/refine the type to something more specific since it isn't a sum type. While with react-query, it's a proper sum type that can be differentiated by checking `isLoading`. The type is actually quite long so here's just a bit export type QueryObserverResult<TData = unknown, TError = unknown> = | Query
Read the rest
ObserverIdleResult<TData, TError> | QueryObserverLoadingErrorResult<TData, TError> | QueryObserverLoadingResult<TData, TError> | QueryObserverRefetchErrorResult<TData, TError> | QueryObserverSuccessResult<TData, TError> export interface QueryObserverLoadingResult<TData = unknown, TError = unknown> extends QueryObserverBaseResult<TData, TError> { data: undefined error: null isError: false isIdle: false isLoading: true isLoadingError: false isRefetchError: false isSuccess: false status: 'loading' } https://github.com/TanStack/query/blob/9b21609350d9ad41faf5c... The key point in the type above is `isLoading: true` and `data: undefined`, which means if I check `isLoading === true`, then typescript knows the data is not available. SWR doesn't provide these guarantees.
In SWR 2.0 – React Hooks for Data Fetching
Here is my final destination after years of path work with notes saving, I been doing this for 3 months and I am extremely happy. three parts. 1/ saving Notes in markdown files on github 2/ using static site generator to create website https://github.com/shuding/nextra 3/ hosting on Vercel for free https://docs-site-coral.vercel.app/ The above is the sample site that was created with Nextra and hosted on Vercel, when you navigate on this site you would appreciate the simplicity of markdown files with good website navigation . Vercel hosted site will be updated as soon as you checkin .md file changes to github All you need to do is clone this repo https://github.com/vercel/swr , npm install and run the site locally . If you like the site, remove the files and replace with your own .md files , check-in into your own github repo , create Ve
Read the rest
rcel account and it will pull your github repo and you Docs site is online .
In How to build a second brain as a software developer

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.