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
Following the example Advanced multiple targets I am passing a component (called <Component />) to my <Timeline /> and use the method targets.set to "assign" a name to an underlying element (here the <div className="someClass" />).
// here props are destructured : { className = '', children }constComponent=forwardRef(({ className ='', children },targets)=>{return(<divclassName={`component ${className}`}><span>{children}</span><divref={(div)=>targets.set('div',div)}className="someClass"/></div>);});
Then I would like to pass props from AnimatedComponent /> to <Component />:
However none of the props (children, className) is passed to <Component />. Can you provide some hint?
My goal is to have two version of the component, one animated and one not.
The text was updated successfully, but these errors were encountered:
capi1O
changed the title
cannot pass props to component passed as <Timeline /> target with forwardRef
cannot pass props to component passed as <Timeline /> target with forwardRef
Jan 27, 2021
Following the example Advanced multiple targets I am passing a component (called
<Component />
) to my<Timeline />
and use the method targets.set to "assign" a name to an underlying element (here the<div className="someClass" />
).Then I would like to pass props from
AnimatedComponent />
to<Component />
:However none of the props (
children
,className
) is passed to<Component />
. Can you provide some hint?My goal is to have two version of the component, one animated and one not.
The text was updated successfully, but these errors were encountered: