Skip to content

Commit

Permalink
Fixing children types
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgperry committed Jan 31, 2025
1 parent 3dd276a commit 47b5d4c
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ import { htmlMotionConfig } from "../html/config-motion"
import { svgMotionConfig } from "../svg/config-motion"
import { CreateVisualElement } from "../types"

type MotionComponent<
T,
P extends { children: any }
> = T extends keyof DOMMotionComponents
type MotionComponent<T, P> = T extends keyof DOMMotionComponents
? DOMMotionComponents[T]
: React.ComponentType<
Omit<MotionComponentProps<P>, "children"> & {
children?: P["children"] | MotionComponentProps<P>["children"]
children?: "children" extends keyof P
? P["children"] | MotionComponentProps<P>["children"]
: MotionComponentProps<P>["children"]
}
>

Expand Down

0 comments on commit 47b5d4c

Please sign in to comment.