I am using a slick carousel component to display products for different pages, so I need to set its title from parent component: something like <Component title="Products" />
Here is the basic structure of my jsx files, can we do it with a simple method like below?
Parent.jsx:
const Parent = () => {
return (
<Component title="Products" />
);
}
export default Parent;
Component.jsx:
const Component = () => {
return (
<h3>
{title}
</h3>
);
}
export default Component;
{ props.title }
will do it. – Kostas Minaidis Mar 25 '22 at 07:38