showing results for - "onclick state change"
Emilia
28 May 2018
1import React, { useState } from 'react';
2import './App.css';
3
4function App() {
5  const [state, setstate] = useState("halwa");
6  const content = () => setstate("halwa2");
7  return (
8    <div>
9      <h1>{state}</h1>
10      <button onClick={content}>change</button>
11    </div>
12  )
13}
14
15export default App
16