File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -88,8 +88,15 @@ export type RoutePropsForPath<Path extends string> = Path extends '*'
8888export function Route < Props > ( props : RouteProps < Props > & Partial < Props > ) : VNode ;
8989
9090declare module 'preact' {
91+ // The code below automatically adds `path` and `default` as optional props for every component
92+ // (effectively reserving those names, so no component should use those names in its own props).
93+ // These declarations extend from `RouteableProps`, which is not allowed in modern TypeScript and
94+ // causes a TS2312 error. However, the compiler does seems to honor the intent of this code, so
95+ // to avoid an API regression, let's ignore the error rather than loosening the type validation.
9196 namespace JSX {
97+ /** @ts -ignore */
9298 interface IntrinsicAttributes extends RoutableProps { }
9399 }
100+ /** @ts -ignore */
94101 interface Attributes extends RoutableProps { }
95102}
You can’t perform that action at this time.
0 commit comments