So ändern Sie die Textfarbe in React
const [color, setColor] = useState('black');
return (
<div style={{textColor: color}}>
colored text
<button onClick={() => setColor('green')}> change to green </button>
</div>
)
Unusual Unicorn