Level 102
If we are going to try and help you, please explain the problem. "not working" can mean many things. Let me guess. You h1 tags are pink instead of red?
Hi, im trying to use useRef() with React.create element but not working
const scrollref = useRef()
<div className='flex flex-col gap-4'>
{settings.p_components.map((block) => {
if (typeof Components[block.component_name] !== "undefined") {
if (block.component_name == "pchForm") {
return React.createElement(Components[block.component_name], {
key: block.id,
product: product,
ref:scrollref
});
}
}
);
}
)}
</div>
I found a solution when i put react createelement inside a div and add ref it works perfectly
Please or to participate in this conversation.