I have to write a condition for showing style on my div but I am making some mistake due to which it is not working properly. Please help me to correct this syntax. This is my code
<div
style={item.settings && 'backdropSettings' in item.settings ? {
item.settings.backdropSettings.value.includes('#') ?
{background:item.settings.backdropSettings.value} :
{backgroundImage: `url(${item.settings.backdropSettings.value})`}
} : null}
>
</div>
if/elseinstead. It's much clearer.if {} else {}inside call of functioncondition ? (condition ? true : false) : (false)