import React, { useState } from 'react'; import { Field, Formik } from 'formik'; import * as Yup from 'yup'; import axios from 'axios'; import { Link, Redirect } from 'react-router-dom'; import styled from 'styled-components'; import { Navbar, Container, Row, Col, Button } from 'react-bootstrap'; const Menu = styled(Navbar)` background-color: #7B031D; a { color : white; } ` function Find() { const [state, setState] = useState(false); if (state) { return ; } return (
비밀번호 찾기 { axios({ method: 'post', url: '/login/find', data: values, }).then(res => { if (res.status === 404) return alert(res.data.error) localStorage.setItem('_id', res.data.users._id) setState(true); }) .catch(err => { alert(err.error) }); console.log(values); setTimeout(() => { setSubmitting(false); }, 400); // finish the cycle in handler }} > {({ errors, touched, handleSubmit, getFieldProps, // contain values, handleChange, handleBlur isSubmitting, }) => (
학번을 입력하세요
답변을 입력해주세요.
)}
); } export default Find