Skip to content

Commit

Permalink
Added comment to 73
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Jul 24, 2023
1 parent d680265 commit 36ad22a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/08-advanced-patterns/68-hoc.solution.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Router, useRouter } from "fake-external-lib";

export const withRouter = <TProps extends { router: Router }>(
Component: React.ComponentType<TProps>,
Component: React.FC<TProps>,
) => {
const NewComponent = (props: Omit<TProps, "router">) => {
const router = useRouter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ import {
} from "react";
import { Equal, Expect } from "../helpers/type-utils";

/**
* FYI - this solution took me the best part of a whole day to find,
* and the help of several TS experts in the community.
*
* So, don't feel bad if you don't find it at all.
*/

export const UnwrappedLink = <T extends ElementType>(
props: {
as?: T;
Expand Down

0 comments on commit 36ad22a

Please sign in to comment.