Joseph Morgan
Published in : 2021-11-29
Reactjs Expected a conditional expression and instead saw an assignment, i can see this warning in the console of my project how can I remove it? the function which cause this error is
async deleteCompany(id){ try{ let res = await axios.delete(BackendURL+'/save/'+id+'/'); if(res.status = 200){ this.props.reload(); } }catch(err){ console.error(err); } }
what should I do?
— Update —
I found the issue. it's because inside the condition there is one “=” it supposed to be at least two “==” or three “===”
There is no comments yet
Join our community and get the chance to solve your code issues & share your opinion with us
Sign up Now