Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[fix]: Expose CompatJSX via jsx-runtime and global namespace augmenta…
…tion
  • Loading branch information
MacBook MacBook
MacBook authored and MacBook committed Jan 11, 2026
commit 6f3b0f07e366c006d9de5eaf4eddfdd5c9c813f8
12 changes: 12 additions & 0 deletions compat/jsx-dev-runtime.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export {
Comment thread
rschristian marked this conversation as resolved.
Outdated
Fragment,
jsx,
jsxs,
jsxDEV,
jsxTemplate,
jsxAttr,
jsxEscape
} from 'preact/jsx-runtime';
import { CompatJSX } from './src/jsx';

export { CompatJSX as JSX };
12 changes: 12 additions & 0 deletions compat/jsx-runtime.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export {
Comment thread
rschristian marked this conversation as resolved.
Fragment,
jsx,
jsxs,
jsxDEV,
jsxTemplate,
jsxAttr,
jsxEscape
} from 'preact/jsx-runtime';
import { CompatJSX } from './src/jsx';

export { CompatJSX as JSX };
8 changes: 8 additions & 0 deletions compat/src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,3 +433,11 @@ declare namespace React {
): void;
export const unstable_now: () => number;
}

// Augment global JSX namespace when preact/compat is imported
declare global {
// eslint-disable-next-line @typescript-eslint/no-namespace
namespace JSX {
interface IntrinsicElements extends CompatJSX.IntrinsicElements {}
}
}