diff --git a/src/App.js b/src/App.js index 8a08ac5..3275454 100644 --- a/src/App.js +++ b/src/App.js @@ -28,19 +28,21 @@ function App() { ); }*/ - const [fName, setfName] = useState(''); +const [input, setInput] = useState(""); +const [list, setList] = useState([]); - const submitValue = () => { - const frmdetails = { - 'First Name' : fName - } - console.log(frmdetails); - }; +const addToList = e => { + setList([ ...list, input ]); + setInput(""); +}; return(
- setfName(e.target.value)} /> - -
+ setInput(e.target.value)} /> + + + ); }