Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit ccd68e0

Browse files
committedJan 16, 2025··
Declare relative-element under React.JSX to fix React 19 compatibility
Fixes #304 I had to add a `@ts-expect-error` comment since otherwise the typechecker would complain about missing `react` as a dependency.
1 parent 8d86a67 commit ccd68e0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎src/relative-time-element-define.ts

+4
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ declare global {
2222
interface HTMLElementTagNameMap {
2323
'relative-time': RelativeTimeElement
2424
}
25+
}
26+
27+
// @ts-expect-error This is needed for consumers using React 19 and above but TypeScript complains because `react` isn't a dependency of the project.
28+
declare module 'react' {
2529
namespace JSX {
2630
interface IntrinsicElements {
2731
['relative-time']: JSXBase['span'] & Partial<Omit<RelativeTimeElement, keyof HTMLElement>>

0 commit comments

Comments
 (0)