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 (