i am using useHook named useGetCompanyByItemId in the return statement.
and so i am getting the error "react hook cannot be called in a callback function"
Extract this logic to a component
function Item({ item, isSharedItem }) { const company = useGetCompanyByItemId(item.id); return ( <> {isSharedItem && ( company )} > ); }
and then use it in your loop
springProps.map((index) => { ... return