I save more strings inside an array. What I want to do is to show them when hover over an icon each of them on separate lines. What I tried so far:
addMessages = () => {
const text = [];
//add strings in the array
return text.join("<hr/>");
}
render() {
const showWhenHover = this.addMessages();
return (
<ActionBar popover={<div> {showWhenHover}</div>}
<div>
<Icon type="myIcon"/>
</div>
</ActionBar>
);
}
}
When I hover over the icon it shows the messages but not each of them on a separate line but all in one line like this:
text1</hr>text2</hr>text3
Isn't <hr/> what must be used in this case? Thanks
<br>return (<div>{text.map((txt, i) => <div key={i}>{txt}<br></div> )}</div>);inaddMessages