I've been trying to convert this to an IF, ElSE statement but I get errors. I just need a rough idea of what it may look like after converting it to IF, ELSE statement.
const shouldCallData = determineShouldCall() ? true : null;
const determineShouldCallData = useCallback() => {
if (!passedInTrendData) {
if (!['measure'].includes(metadata?.Type || type))
? metadata?.Controls
? !['trendChat', 'detailsChart', 'chart', 'measure'].includes(metadata?.Type || type)
? metadata.Controls & 4
? true
: null
: true
: true
:false
} else if (Array.isArray(passedInTrendData)) {
if (!passedInTrendData.find(item => item.Id === id)) {
return true;
}
}
return false;
}, [id, passedInTrendData]);
Aucun commentaire:
Enregistrer un commentaire