Skip to content

fix: Eliminate TS2312 error in router.d.ts#130

Merged
rschristian merged 1 commit intopreactjs:mainfrom
octogonz:main
Dec 8, 2025
Merged

fix: Eliminate TS2312 error in router.d.ts#130
rschristian merged 1 commit intopreactjs:mainfrom
octogonz:main

Conversation

@octogonz
Copy link
Contributor

@octogonz octogonz commented Dec 8, 2025

This is a fix for #129 and #94

If we wanted to be more correct but less ergonomic, an alternate possibility would be:

// A simplified version of RoutableProps that can be used with "extends"
interface JsxRoutableProps {
	path?: string;
	default?:boolean
}	

declare module 'preact' {
	namespace JSX {
		interface IntrinsicAttributes extends JsxRoutableProps {}
	}
	interface Attributes extends JsxRoutableProps {}
}

@rschristian @aymericzip

Copy link
Member

@rschristian rschristian left a comment

Choose a reason for hiding this comment

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

Cheers

octogonz added a commit to octogonz/preact-iso-repro that referenced this pull request Dec 8, 2025
@octogonz
Copy link
Contributor Author

octogonz commented Dec 8, 2025

I added some test cases to my repro branch:

https://github.com/octogonz/preact-iso-repro/blob/main/src/test.tsx

...and confirmed that the outcome of the test cases is unaffected by these changes.

@rschristian rschristian merged commit 54e3624 into preactjs:main Dec 8, 2025
1 check passed
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