Skip to content

Conversation

sunil5151
Copy link

Problem

The current documentation only demonstrates using the use() hook for handling Promises passed from Server Components to Client Components. However, developers can also manually resolve Promises using useEffect and useState, which provides more granular control over loading states and error handling.

Solution

Added a new Note section in "Async components with Server Components" that:

  • Explains the manual Promise handling pattern using useEffect + useState
  • Provides a complete code example with error handling and cleanup
  • Lists use cases where this pattern might be preferred over use()
  • Maintains both options as valid approaches, helping developers choose based on their needs

Changes

  • Added a new Note section titled "Alternative: Manual Promise handling in Client Components"
  • Included practical code example demonstrating the pattern
  • Listed specific scenarios where manual handling provides benefits
  • Preserved the existing use() documentation while presenting this as an alternative approach

This addition helps developers understand all available patterns for handling async data in React Server Components, enabling them to make informed architectural decisions.

sunilsonumonu12 and others added 6 commits September 16, 2025 22:23
- Replace straight quotes with HTML entities (“ ”) around 'mirroring' and 'Mirroring'
- Fixes typography issue where smart quotes plugin rendered double opening quotes
- Ensures consistent curly quote rendering in both instances (lines 358, 367)

Resolves mismatched quote rendering in choosing-the-state-structure.md
@meta-cla meta-cla bot added the CLA Signed label Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant