I am new to web development, so this is probably pretty fundamental. I want to add a data attribute to the div tag if the datainfo prop variable is not empty
<div style={{height: props.height - handleHeight()}} data={datainfo ? datainfo : ""}>
But right now the data attribute is added with an empty value if the datavalue is empty. Instead I want it to not appear in the div tag at all.
Can I add the whole thing in the JSX clause or how to do it?