Loading video...

Video Failed to Load

Go Home

Here's what I'm using for RSC toast. - flash() function that server actions can call - useFlash() hook on the client that gets populated by all the server-side flash invocations Works with redirects, revalidation, progressive enhancement, etc. Blog post soon!

22,637 views • 1 year ago •via X (Twitter)

11 Comments

Ryan Toronto's profile picture
Ryan Toronto1 year ago

It works by the server action setting a short lived cookie that's readable by js The browser uses cookie change event and when it sees a new flash cookie it'll populate state in useFlash() Browser then immediately deletes the cookie

Ryan Toronto's profile picture
Ryan Toronto1 year ago

Small update: No more cookie change event- Cookies are read in RSC and put in client component that populates context. That was missing piece to get SSR fully functional

Safari Web Extensions's profile picture
Safari Web Extensions1 year ago

Discover the top Safari web extensions to boost productivity, enhance workflow, and customize your browsing experience on Mac, iOS, and iPadOS.

Sam Selikoff's profile picture
Sam Selikoff1 year ago

Awesome! Does it depend on any framework-specific features or could it theoretically be a pure React lib?

Ryan Toronto's profile picture
Ryan Toronto1 year ago

It uses cookies, so it depends on your frameworks cookie impl (ie import {cookies} form "next/headers") But maybe there's a way to make an adapter layer that hooks into all the frameworks

Jack's profile picture
Jack1 year ago

yep been doing exact same, so easy to do it from the server

Zafar's profile picture
Zafar1 year ago

Awesome. Thanks for sharing.

Seb ⚛️ ThisWeekInReact.com's profile picture
Seb ⚛️ ThisWeekInReact.com1 year ago

IMHO this is the way @rwieruch Convenient to use, preserves progressive enhancement

pavi2410's profile picture
pavi24101 year ago

does this work similar to this?

zhxnrs's profile picture
zhxnrs1 year ago

Just why

Kiran's profile picture
Kiran1 year ago

But why?

Related Videos

🚨 POC for CVE-2025-55182 that works on Next.js 16.0.6 Here are the exact, battle-tested queries you need — Censys, Shodan, FOFA, ZoomEye, Quake, BinaryEdge, and Nuclei matchers — all tuned specifically to find Next.js RSC / React Server Components instances vulnerable to CVE-2025-55182 (React2Shell). ⸻ ✅ 1. SHODAN QUERY (380K+ ASSETS) Find all servers leaking RSC Server Actions: Basic Query "Vary: RSC, Next-Router-State-Tree" More Aggressive Variant http.headers.vary:"RSC" AND http.headers.vary:"Next-Router-State-Tree" Superwide Coverage "Next-Router-State-Tree" OR "x-nextjs-cache" OR "server-actions" OR "__RSC__" Focused on Vulnerable Cache Indicators "x-nextjs-cache: HIT" "Next-Router-State-Tree" ⸻ ✅ 2. CENSYS QUERY (270K+ ASSETS) (match the screenshot you posted) Exact Censys Search services.http.response.headers.vary: "RSC, Next-Router-State-Tree" Safer Multi-Matcher services.http.response.headers.vary: "RSC" AND services.http.response.headers.vary: "Next-Router-State-Tree" Detect RSC Payload Exposure (critical) services.http.response.body: "__RSC__" Detect Flight Data Leaks services.http.response.body: "server-reference-manifest" ⸻ ✅ 3. FOFA QUERY (CHINA’S OSINT GIANT) (VERY POWERFUL for RSC/Next.js) Exact Header Based header="Next-Router-State-Tree" && header="RSC" Alternative (match screenshot patterns) "Next-Router-State-Tree" && "x-nextjs-cache" For massive result count body="__RSC__" || header="server-actions" ⸻ ✅ 4. ZOOMEYE QUERY ZoomEye scans often catch Node.js apps Shodan misses. Exact Unicode-Ready Query "Next-Router-State-Tree" && "RSC" Advanced app:"Next.js" && header:"RSC" ⸻ ✅ 5. QUAKE SEARCH (360K+ MATCHES) header:"Next-Router-State-Tree" AND header:"RSC" ⸻ ✅ 6. BINARYEDGE QUERY http.response.headers.vary:"Next-Router-State-Tree" ⸻ ✅ 7. QUERY headers:"Next-Router-State-Tree" && headers:"RSC" ⸻ 🎯 8. NUCLEI MATCHER (to detect RSC without scanning payloads) If you want a nuclei detector you can plug into your scanner: matchers: - type: word part: header words: - "RSC" - "Next-Router-State-Tree" - "server-actions" - "__RSC__" ⸻ 🚩 BONUS — THE MOST ADVANCED CROSS-ENGINE QUERY Use this when you want maximum global coverage: "Next-Router-State-Tree" OR "RSC" OR "__RSC__" OR "server-actions" OR "x-nextjs-cache" OR "Next-Server-Action" This identifies: •Next.js App Router •RSC endpoints •Server Actions •Flight data APIs •Pages exposing cache HITs (required for exploitation) •Systems likely vulnerable to CVE-2025-55182 (React2Shell)

X

10,469 views • 6 months ago