You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wanna use dynamic framer component with tag prop like below.
import{m}from"framer-motion";interfaceProps{tag: keyoftypeofm;}// 🤔 how can infer ref type instead of "unknown" type?constDynamicFramerComponent=forwardRef<unknown,Props>(({ tag },ref)=>{constFramerElement=m[tag];// Very complex type error!return<FramerElementref={ref}/>});
In this context, how can I infer type of ref with dynamic tag prop(span, div ...)? I tried lots of type definition but failed 😢
Is it possible? Thanks for your reading!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, thanks for your great library!
I wanna use dynamic framer component with tag prop like below.
In this context, how can I infer type of
ref
with dynamic tag prop(span
,div
...)? I tried lots of type definition but failed 😢Is it possible? Thanks for your reading!
Beta Was this translation helpful? Give feedback.
All reactions