Skip to content

Conversation

@unional
Copy link
Contributor

@unional unional commented Dec 30, 2025

Closes #9422

Note that this PR fix the type which is technically breaking, as it makes the type validation function properly.

The change to CoachMark.tsx shows the breakage:

- export const CoachMarkContext = createContext<ContextValue<CoachMarkProps, HTMLElement>>({});
+ export const CoachMarkContext = createContext<ContextValue<Partial<CoachMarkProps>, HTMLElement>>({});

Although the breakage can be "avoided" by:

- export type SlottedContextValue<T> = SlottedValue<T> & T | null | undefined;
+ export type SlottedContextValue<T> = SlottedValue<T> & Partial<T> | null | undefined;

Keeping the Partial<T> in user land is more flexible and more correct, e.g. if the user want to NOT doing Partial<T> for their specific use case.

✅ 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:

Run yarn check-types

@snowystinger snowystinger changed the title fix: update CoachMarkContext and SlottedContextValue types for better… fix: CoachMarkContext and SlottedContextValue types for autocomplete Jan 3, 2026
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, the CoachMark one looks like it's now being handled the same way as the Button in S2, so I think that's fine.

@reidbarber reidbarber added this pull request to the merge queue Jan 7, 2026
Merged via the queue into adobe:main with commit a4065ed Jan 7, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TypeScript]: autocomplete is not available on ContextValue<T, E>

3 participants