How to show html entity using React?
Another option is to use fromCharCode method:
const formatArea = (val) => {
return val + ' ft' + String.fromCharCode(179);
}
New way using React's fragments:
<>³</>
In your case it can be:
const formatArea = function(val){
return <>{val + ' '}³</>
}
Found this way using JSX:
const formatArea = (val) => {
return (<span>{val} ft<sup>3</sup></span>);
}