const res = {
first: 'текст1',
second: "текст2"
};
const Textarea = ({ style = {}, ...props }) => {
const input = useRef();
return (
<textarea style={{ height: "auto", ...style }} ref={input} rows={1} {...props} />
);
}
<div>
<div className={panel === 0 ? "selected" : ''} onClick={() => setPanel(0)}>0</div>
<div className={panel === 1 ? "selected" : ''} onClick={() => setPanel(1)}>1</div>
<div className={panel === 2 ? "selected" : ''} onClick={() => setPanel(2)}>2</div>
</div>
{panel === 0 ?
<div>
<Textarea style={{fontSize: '12pt'}} value={res.first} readOnly={true} />
</div>
: panel === 1 ?
<div></div>
: panel === 2 ?
<div>
<Textarea style={{fontSize: '10pt', fontSize: 'monospace'}} value={res.second} readOnly={true} />
</div>
: null}