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 }
const Component = forwardRef(({ className = '', children }, targets) => {
return (
<div className={`component ${className}`}>
<span>{children}</span>
<div ref={(div) => targets.set('div', div)} className="someClass" />
</div>
);
});
Then I would like to pass props from AnimatedComponent /> to <Component />:
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.