I am using React with Ant Design, but this is only a react issue.
I have a code like this:
{
title: "Group",
dataIndex: "group",
key: "group",
render: text => (
<a> {text} </a>
)
}
Not the render: text => () which allows me to use html inside a js function (or jsx?)
but, if I try to put if/else logic I get always an error.
Right now I am using something stupid like this:
render: texts => (
<span>
{[""].map(text => {
if(texts.includes(":")) {
return (<b> {texts} </b>)
}
return (<a> {texts} </a>)
})}
</span>
The questions is, is there a way to do it without using [""].map() and why won't simple if/else work