const {id}=useParams();
useEffect(()=>{
if(id){
getSingleUser(id);
}
},[id])
const getSingleUser= async(id)=>{
const res= await EmployeeService.getEmployeeById(id);
let employee = res.data;
setState({ ...res.data[0]
});
console.log(employee);
};
this shows error TypeError: Object(...) is not a function how can I solve this.