import React, { useEffect, useState } from 'react'; import { CircularProgress } from '@material-ui/core'; import Notification from '../../component/notification'; import { ToastContainer, toast } from 'react-toastify'; import 'react-toastify/dist/ReactToastify.css'; import axios from 'axios'; import { useHistory } from 'react-router-dom' const Child = () => { const [children, setChildren ] = useState(null); const [loading, setLoading] = useState(true); const history = useHistory(); const state = history.location.state useEffect(() => { axios.get('/api/children/listOfFather', {params: { father_id: 1 }}).then((response) => { if(response.data.status_code==200){ console.log(response.data.params); setChildren(response.data.params); } else if(response.data.status_code==400){ //TODO } setLoading(false); if(state?.message) { toast.success(state?.message, { position: "top-center", autoClose: 5000, className:"bg-success", hideProgressBar: true, closeOnClick: true, pauseOnHover: true, draggable: false, progress: undefined, style:{ color: '#ffffff', opacity: 0.95} }); } }); }, []); return (

子一覧

{ e.preventDefault(); history.push({ pathname: '/p-account/child/add', state: {} }); }} data-v-ade1d018="" className="btn-default btn-yellow btn-meeting btn-shadow btn-r8 btn-h48 btn-fz14"> 子を追加
) } export default Child;