import React, { useState, useContext } from “react“;
import ThemeContext from “../context/ThemeContext“;
const ThirdExercise = () => {
const [text, setText] = useState(false);
const color = useContext(ThemeContext)
const handleClick = () => {
setText(!text);
}
return (
<div>
<h1 style={{ color }}>Software Evolutivo</h1>
<button type=”button“ onClick={handleClick}>
{text ? “Text 1“: “Text 2“}
</button>
</div>
);
};
export default ThirdExercise;