Skip to content

Instantly share code, notes, and snippets.

@abdelfattah-atef94
Created March 31, 2020 10:57
Show Gist options
  • Save abdelfattah-atef94/4db2becbb8ef58672244a97b632a08e7 to your computer and use it in GitHub Desktop.
Save abdelfattah-atef94/4db2becbb8ef58672244a97b632a08e7 to your computer and use it in GitHub Desktop.
import React, { useState } from "react";
export default function App() {
const [inputValue, setInputValue] = useState("");
const handleSubmitButton = () => {
alert(inputValue);
};
return (
<div className="App">
<input value={inputValue} onChange={e => setInputValue(e.target.value)} />
<input type="submit" value="submit" onClick={handleSubmitButton} />
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment