Fix TypeScript error in create-proxy component#3506
Conversation
The CreateVisualElement parameter type was too narrow (defaulting to
CreateVisualElement<{}, "div">), causing type errors when passed to
the generic createMotionComponent function. Changed to use explicit
<any, any> type parameters to allow the proxy to work with any props
and tag names.
Code ReviewThis PR fixes a TypeScript type compatibility issue in AnalysisThe Problem: type CreateVisualElement<Props = {}, TagName extends keyof DOMMotionComponents | string = "div">When passed without explicit type parameters, the parameter in The Solution: createDomVisualElement as CreateVisualElement<Props, TagName>Code Quality✅ Minimal change - Single line modification that directly addresses the issue Concerns & Recommendations1. Missing Test Coverage
|
The CreateVisualElement parameter type was too narrow (defaulting to CreateVisualElement<{}, "div">), causing type errors when passed to the generic createMotionComponent function. Changed to use explicit <any, any> type parameters to allow the proxy to work with any props and tag names.