How can I get the user value in the text field component.
This is the form text field value I want to populate. I am using material ui and tried using hooks and useEffect to get the desired results.
<TextField variant="outlined" margin="normal" required fullWidth name="password" label="Password" type="password" id="password" autoComplete="current-password" autoFocus /> <FormControlLabel control={<Checkbox value="remember" color="primary" />} label="Remember me" /> <Button type="submit" fullWidth variant="contained" color="primary" className={classes.submit} onClick={handleClick} > Sign In </Button> </form> How can I get the password in alert/console log on handleClick. const handleClick = () => { console.log(password); };