[英]no-unused-expressions: Expected an assignment or function
I'm new in full stack developing and I'm trying to code something to understand better frontend with React JS and Material UI.我是全栈开发的新手,我正在尝试编写一些代码来更好地理解 React JS 和 Material UI 的前端。 In this component, console give me this error at line 75(
this.props.isFriend(handle)
) but I do not understand what is wrong.在这个组件中,控制台在第 75 行给了我这个错误(
this.props.isFriend(handle)
),但我不明白出了什么问题。
componentDidMount(){
const {
profile: { handle }
} = this.props;
this.props.isFriend(handle);
}
How can I do?我能怎么做?
This line returns a value when it executes (probably a boolean), but it is not used, that's what the error message is telling you.此行在执行时返回一个值(可能是布尔值),但未使用它,这就是错误消息告诉您的内容。 You need to do something with the returned value.
您需要对返回的值做一些事情。
Ex.前任。
this.isFriend = this.props.isFriend(handle);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.