Skip to content

Commit 35b5af3

Browse files
committed
Changed 70 solution
1 parent 9ac77a1 commit 35b5af3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/08-advanced-patterns/70-as-prop-with-custom-components.solution.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
import React, { ComponentPropsWithoutRef, ElementType } from "react";
1+
import React, { ElementType } from "react";
22
import { Equal, Expect } from "../helpers/type-utils";
33

4-
export const Wrapper = <T extends ElementType>(
4+
export const Wrapper = <TAs extends ElementType>(
55
props: {
6-
as: T;
7-
} & ComponentPropsWithoutRef<T>,
6+
as: TAs;
7+
} & React.ComponentPropsWithoutRef<TAs>,
88
) => {
99
const Comp = props.as;
10+
1011
return <Comp {...(props as any)}></Comp>;
1112
};
1213

0 commit comments

Comments
 (0)