user image

Joseph Morgan
Published in : 2021-11-29

[solved] Expected a conditional expression and instead saw an assignment

React js

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 “===”
 

web-brackets.com

Comments

There is no comments yet

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

Module not found: Can't resolve 'swiper' in Reactjs [Solved]
Publish date: 2021-10-03 | Comments: 1

Tag: React js

TypeError: Super expression must either be null or a function
Publish date: 2022-03-13 | Comments: 2

Tag: React js

Could not be processed as an image because it has an invalid content type
Publish date: 2021-12-08 | Comments: 0

Tag: React js

How to get the selected object in "Autocomplete material ui"?
Publish date: 2021-12-22 | Comments: 3

Tag: React js

How to implement SSO with React and ASP.NET Core Web API ?
Publish date: 2022-11-03 | Comments: 0

Tag: React js

TypeError: Cannot read properties of null (reading 'scrollTop') in jest
Publish date: 2022-09-08 | Comments: 1

Tag: React js