Skip to content

Conversation

web-padawan
Copy link
Member

Description

Upgraded react and related dependencies to v19, fixed two compilation errors due to @types/react breaking changes.

Type of change

  • Breaking change

// Components with slot attribute should stay in light DOM.
const slottedChildren = children.filter((child): child is ReactNode => {
return isValidElement(child) && child.props.slot;
return isValidElement(child) && (child.props as any).slot;
Copy link
Member Author

Choose a reason for hiding this comment

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

Related to this change:

The props of React elements now default to unknown instead of any if the element is typed as ReactElement.

See DefinitelyTyped/DefinitelyTyped#69022 - "Changes to Type Parameters" - "ReactElement"

config?: RendererConfig<W>,
): UseRendererResult<W> {
const [map, update] = useReducer<typeof rendererReducer<W>>(rendererReducer, initialState);
const [map, update] = useReducer(rendererReducer, initialState);
Copy link
Member Author

Choose a reason for hiding this comment

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

Related to this change:

The new best practice is not to pass type arguments to useReducer.

See DefinitelyTyped/DefinitelyTyped#69022 - "Changes to Type Parameters" - "useReducer"

@web-padawan
Copy link
Member Author

web-padawan commented Sep 23, 2025

Regarding this error - we've seen it before and had to downgrade types in #308:

[types]   Types of property 'part' are incompatible.
[types]     Type 'string | undefined' is not assignable to type 'DOMTokenList | undefined'.
[types]       Type 'string' is not assignable to type 'DOMTokenList'.

@web-padawan web-padawan removed the request for review from vursen September 24, 2025 08:05
@web-padawan web-padawan merged commit c18aaff into main Sep 24, 2025
2 checks passed
@web-padawan web-padawan deleted the feat/react-19 branch September 24, 2025 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants