New "Learn" Docs Section for Async #2
Replies: 4 comments 10 replies
-
I think @rickhanlonii 's talk from ReactConf is a good conceptual starting point for these docs. I'm generally picturing some sections that cover:
|
Beta Was this translation helpful? Give feedback.
-
Thanks for starting this convo, I have some ideas for this so I'll do a brain dump. QuickSome quick things we can ship:
Medium-ishThese are less concrete, but fairly straight forward:
BiggerLike you mentioned in the post, we need learn docs for these patterns. I was thinking a new top level section like:
Some of this is tricky because if you're using a framework, or router/data/design libraries that support these patterns, then these docs are not relevant to you - this is just the way it works. But I think we can explain that somehow, so you know why the app works the way it does when you see it. |
Beta Was this translation helpful? Give feedback.
-
Related: @rickhanlonii , did you have a chance to publish the demo app repo anywhere? If not, could you do that? Saw some folks asking to see the code. |
Beta Was this translation helpful? Give feedback.
-
I'd add that originally (when the docs were being written) Fetching Data was supposed to be a section that comes between Describing the UI and Adding Interactivity. That's also why Describing the UI was written without any client features. The idea was to show Suspense etc before showing state because Suspensey data fetching is router-driven (at least in RSC), and using router doesn't force you to learn about state. Explaining patterns like Transitions and Suspense just relies on having a router. (Look at examples on https://react.dev/reference/react/Suspense — most of this stuff is not related to state.) Indeed, in the default RSC environment you can't use state directly even if you want to, so it kind of makes sense to explain So the idea was that Describing the UI is universal, then Fetching Data teaches you declarative data fetching and patterns around that (and animations), and the next section (Adding Interactivity) is when we teach about This ended up getting deprioritized because it involved making decisions for how sandboxes should work (eg. what should the mock router be like, should it use a framework or a fake framework, should it be "true RSC", "RSC in a worker", "client-side RSC-like" thing, something client-only but with right conventions, etc.) I would highly encourage whoever decides to pick up this section to avoid tying explanations to state (even if it ends up after Interactivity in the end) or making them seem like we're explaining complex concepts. In the end it's just |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
At React Conf 2025, there were a number of conversations around how we could improve the React.dev docs story around async features in React. In particular, it feels like many APIs are solely documented in the reference documentation section.
I'd like to propose that we introduce a new section in the "Learn" docs that covers:
Maybe we could name this section as something like "Handling Data"? In my opinion, it would make sense to structure these pages as:
use
,Suspense
,cache
,cacheSignal
)<form action>
,startTransition
)useOptimistic
,useTransition
)And going from there.
Once we figure out a good structure for these docs, I'm happy to begin working on the docs pages related to this and we can do a more in-depth review in PRs
Beta Was this translation helpful? Give feedback.
All reactions