Reactjs – React component rerenders after setting state to the same value
import { useState } from "react"; export default function App() { const [buttonClicked, setButtonClicked] = useState(false); console.log('Render'); return ( <div className="App"> <button onClick={() => setButtonClicked(true)}>Click me</button> {buttonClicked && <div>Button was clicked</div>} </div> ); } This component is not running in…