Untitled
const [nameValue, setName] = useState("") const [descValue, setDesc] = useState("") const handleFormSand = () => { console.log(nameValue, descValue) // submit form } return ( <Box as="form" onSubmit={(e) => { e.preventDefault() handleFormSand() }}> <Input placeholder="L'art de ..." mb={3} value={nameValue} onChange={(e)=> { setName(e.target.value) }} /> <Textarea name="gDesc" id="gDesc" rows={6} mb={3} value={descValue} placeholder="Bla bla bla bla bla ..." onChange={(e)=> { setDesc(e.target.value) }} /> <Button>Enregistrer</Button> </Box> ); }
Leave a Comment