import React, { useEffect, useState } from 'react'; import { CircularProgress } from '@material-ui/core'; 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(); 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); }); }, []); 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"> 子を追加
1
{ !loading ? children?.map((child, index) => { return ( ); }) :
}
) } export default Child;