I'm trying to assign a variable which will be a JSX element in ReactJS.
I want to do it like that:
const [useResultText, setResultText] = useState('');
const changeState = () => {
const br = <br />
setResultText('Hello' + br + 'world');
}
return (
<div onClick={changeState}>{useResultText}</div>
);
Is there any way to do it?