~/talk

React Query and Auth: Who is Responsible for What?

Talkat React Advanced 2021 · 2021-10-22..10-23· [react, security]
slides:none on file

Proposes a concrete solution: a Day Spa app using React Query (useQuery, useMutation, dependent queries) plus auth and localStorage with a central useUser hook that keeps the canonical user state, updates the react-query cache, and resolves the id chicken‑egg by disabling the fetch until user exists. Code lives in completed apps/lazyday-spa/client on GitHub. Mentions npm wrappers react-query-auth (~500 downloads/week), react-query-firebase (~30/week), and react-query (~575k/week). The approach is implemented and keeps server, client cache, and persistence in sync.

AI-written summary · about

  1. 0:00Intro
  2. 1:15Introductory Notes
  3. 2:07Table of Contents
  4. 2:50What is React Query?
  5. 3:31Keeping Data in Sync with Server
  6. 4:25More React Query Concepts
  7. 5:31Context for This Talk
  8. 6:15Authentication
  9. 7:13User data has lots of owners
  10. 8:28Reason 1: Mutations
  11. 9:42Reason 2: Startup
  12. 11:49Centralize with useUser Hook
  13. 13:44useUser hook return values
  14. 14:18All updates go through useUser
  15. 15:02React Query Auth
  16. 16:29React Query Firebase
  17. 17:15Both still finding traction
  18. 17:46Main Players
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.