Skip to content

fix: collections nested within Activities (React 19.2)#9300

Merged
snowystinger merged 25 commits intoadobe:mainfrom
mhornbacher:fix-activities-with-collections
Feb 8, 2026
Merged

fix: collections nested within Activities (React 19.2)#9300
snowystinger merged 25 commits intoadobe:mainfrom
mhornbacher:fix-activities-with-collections

Conversation

@mhornbacher
Copy link
Contributor

Closes #9173

✅ Pull Request Checklist:

  • Included link to corresponding React Spectrum GitHub Issue.
  • Added/updated unit tests and storybook for this change (for new code or code which already has tests).
  • Filled out test instructions.
  • Updated documentation (if it already exists for this component).
  • Looked at the Accessibility Practices for this feature - Aria Practices

📝 Test Instructions:

Nest any component that uses Collections (Table, ListBox, Tabs...) within an Activity or a Next.js app route using cache components

Copy link
Member

@snowystinger snowystinger left a comment

Choose a reason for hiding this comment

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

Thanks for starting this. Let's see if we can get the PR checks passing.
You can run lint locally with yarn lint

@mhornbacher
Copy link
Contributor Author

@snowystinger added @storybook/blocks as well due to this failure

@mhornbacher
Copy link
Contributor Author

@snowystinger thanks for jumping in. Lets get this out!

I got most of the CI working but something seems up with the TS scripts... is this a known issue or is this introduced by this PR?

@mhornbacher
Copy link
Contributor Author

Hm, it looks like the issue is that it is a new symlink.... 🤔

It is my birthday today so I will be offline for a bit with my family but it should be simple enough to patch later.

How do you feel about the fix otherwise?

@snowystinger
Copy link
Member

I think the issue was just multiple copies of React. I've resolved it. The team will be a little slow reviewing due to a combination of some other priorities, the upcoming holidays, and current holidays. In the meantime, you can use it via patch-package or yarn patch or any of those kinds of tools.

@mhornbacher
Copy link
Contributor Author

Sounds good! No rush I just hope it doesn't get lost in the holiday festivities 🍾

Thank you very very much for fixing the packages issues! Ill look into patching it locally for now and keep an eye on this PR :)

@mhornbacher
Copy link
Contributor Author

Hey! Just wanted to put a comment here to raise this up so it doesn't get lost :)

@snowystinger
Copy link
Member

Thanks for the bump, it's definitely on our radar. Just to set realistic expectations though, we are very late in our release cycle, so it's unlikely we will include this, there isn't sufficient time to discuss and test it with our focus being S2 getting it's first 1.0 release and getting our new docs finished up before holidays. I am polling the group to see if we want to make an exception since Next is shipping with this by default, but collections are the base of so many things, and we want to make sure we don't negatively affect performance or inadvertently change behaviour.

@snowystinger
Copy link
Member

Brought it up with the team and unfortunately we judged it to be too close to release to make it in to this one.

Thanks again, we'll make sure to review it in the near future, though as a heads up, Adobe does shut down for the holidays. Any replies to issues/PRs will be support oriented for the next few weeks and less dev focused.

# Conflicts:
#	starters/docs/package.json
@mhornbacher
Copy link
Contributor Author

The new Docs are incredible!

No rush at all, I just know things like this can get lost. If it helps I'll rebase on main and leave a comment mid-January so it can be brought up in the new year.

I am moving my project to Tanstack Start where this works incredibly well as we where just running into too many issues with Server components in NextJS especially around more interactive site-wide elements that are important to us.

Have a very festive and merry holiday season!

@snowystinger
Copy link
Member

Looks like something has changed in the collections implementation that doesn't like this, will need to track that down and revisit.

@devongovett
Copy link
Member

Looks like something has changed in the collections implementation that doesn't like this, will need to track that down and revisit.

I think it was caused by the useEffectEvent change that we have since reverted. Merging in main again fixed it.

Also I was able to simplify the fix a bit. The root cause was that we clone the collection during subscription updates inside getCollection to force a re-render. But when there are no subscriptions registered (due to Activity being hidden) this did not occur. Then when React later checked whether an update was needed just before the Activity becoming visible, it saw the collection hadn't changed and didn't schedule a render. The solution is moving the clone within queueUpdate so that it occurs even when there are no subscriptions.

@snowystinger snowystinger added this pull request to the merge queue Feb 8, 2026
Merged via the queue into adobe:main with commit b670a53 Feb 8, 2026
28 checks passed
@mhornbacher
Copy link
Contributor Author

@devongovett this fix is awesome!!! Thank you!

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.

Collection is not built when React.Activity is set to visible the first time

3 participants