Skip to content

Commit

Permalink
Add type spec for ComponentProps.
Browse files Browse the repository at this point in the history
  • Loading branch information
molefrog committed Dec 17, 2023
1 parent fbf6fc8 commit 2dec5df
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/wouter/test/link.test-d.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, expectTypeOf, it } from "vitest";
import { Link, type Path } from "wouter";
import { Link, LinkProps, type Path } from "wouter";
import * as React from "react";

type NetworkLocationHook = () => [
Expand Down Expand Up @@ -190,4 +190,11 @@ describe("<Link /> with `asChild` prop", () => {
<a>Hello</a>
</Link>;
});

it.skip("should work with `ComponentProps`", () => {
type LinkComponentProps = React.ComponentProps<typeof Link>;

// @ts-expect-error FIXME
expectTypeOf<LinkComponentProps>().toEqualTypeOf<LinkProps>();
});
});

0 comments on commit 2dec5df

Please sign in to comment.