function Button(props){
return (
<button onClick={props.onClickFunction}>
+1
</button>);
}
function Display(props){
return(
<div>{props.message}</div>);
}
function App(){
const [counter, setCounter] = useState(0);
const handleClick = () => setCounter(counter+1);
return (
<>
<Button onClickFunction= {handleClick}/>
<Display message={counter}/>
</> );
}
ReactDOM.render(
<App />,
document.getElementById('mountNode')
);