Skip to content

Expand FragmentInstance reference docs#8309

Open
jackpope wants to merge 6 commits intoreactjs:mainfrom
jackpope:fr-update
Open

Expand FragmentInstance reference docs#8309
jackpope wants to merge 6 commits intoreactjs:mainfrom
jackpope:fr-update

Conversation

@jackpope
Copy link
Contributor

@jackpope jackpope commented Feb 17, 2026

Preview

  • Rewrites FragmentInstance reference with per-method API docs
  • Adds scrollIntoView reference and usage example
  • Documents reactFragments DOM handle and global IntersectionObserver caching pattern
  • Fixes bugs and improves all Fragment ref usage examples

@github-actions
Copy link

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌


Fragment `ref`s provide `focus`, `focusLast`, and `blur` methods that operate across all DOM nodes within the Fragment:

```js {5-6}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move this, and the other demos to Sandpacks?


```js
const observer = new IntersectionObserver(callback, options);
fragmentRef.current.observeUsing(observer);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to this docs PR, but not sure where else to ask.

Is there a convenient way to get a list of refs from a fragment ref?
If not, this looks like something devs will find workarounds for 😄. cc @rickhanlonii might be worth reviewing this use case (and this whole post overall)

Image

https://barvian.me/react-exit-animations

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.

3 participants