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

import link as router link from 'react-router-dom' Reactjs
Publish date: 2021-09-30 | Comments: 3

Tag: React js

Export 'Switch' (imported as 'Switch') was not found in 'react-router-dom'
Publish date: 2022-04-02 | Comments: 2

Tag: React js

Unexpected mix of '&&' and '||' Reactjs
Publish date: 2021-10-30 | Comments: 0

Tag: React js

Best way to update the state in one class component from the redux store?
Publish date: 2022-03-30 | Comments: 3

Tag: React js

How to use SetFieldValue from outside render function? Formik
Publish date: 2021-07-03 | Comments: 2

Tag: React js