© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago
Mathias

Query data with Next.js

Has anyone found a good way to query for data when using Next.js. I tried using useSWR (https://swr.vercel.app/) and it works, but I'm not sure if that is the recommended way of doing it?

I find it cumbersome to use useEffect and set a state each time I want to query for data.

Any good suggestions?
React Hooks for Data Fetching – SWR
SWR is a React Hooks library for data fetching. SWR first returns the data from cache (stale), then sends the fetch request (revalidate), and finally comes with the up-to-date data again.
React Hooks for Data Fetching – SWR
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Data fetching - query filter using Next.js router.query returns error.
SupabaseSSupabase / help-and-questions
4y ago
Next.js | Problem with session data inside getServerSideProps
SupabaseSSupabase / help-and-questions
4y ago
Getting user data on dynamic page with Next JS
SupabaseSSupabase / help-and-questions
4y ago
Next Js 16, Data-Access-Layer with auth check
SupabaseSSupabase / help-and-questions
3mo ago