Skip to content

Commit

Permalink
Changed the way that 70 starts out
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpocock committed Aug 7, 2023
1 parent 782759d commit 9ac77a1
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,14 @@ import { Equal, Expect } from "../helpers/type-utils";
* - ComponentPropsWithRef
* - ComponentProps
*/
export const Wrapper = (props: { as: unknown }) => {
const Comp = props.as;
return <Comp {...props}></Comp>;
export const Wrapper = <TAs extends keyof JSX.IntrinsicElements>(
props: {
as: TAs;
} & React.ComponentProps<TAs>,
) => {
const Comp = props.as as string;

return <Comp {...(props as any)}></Comp>;
};

/**
Expand Down

0 comments on commit 9ac77a1

Please sign in to comment.