79374619

Date: 2025-01-21 13:41:25
Score: 1
Natty:
Report link

You can wrap the icon prop inside an object:

import { HomeIcon } from '@heroicons/react/24/outline';

function TargetComponent({ icon }){

    const iconObj = { icon };

    return <iconObj.icon />
}

function ParentComponent () {
    return <TargetComponent icon={ HomeIcon } />
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: gfalco