我是全栈开发的新手,我正在尝试编写一些代码,以便更好地理解React JS和Material UI的前端。在这个组件中,console在第75行( this.props.isFriend(handle))给出了这个错误,但我不知道是什么地方出了问题。
componentDidMount(){
const {
profile: { handle }
} = this.props;
this.props.isFriend(handle);
}我该怎么做呢?
发布于 2020-12-24 06:53:07
这一行在执行时返回一个值(可能是一个布尔值),但没有使用它,这就是错误消息告诉您的。您需要对返回值执行一些操作。
例如。
this.isFriend = this.props.isFriend(handle);https://stackoverflow.com/questions/65431867
复制相似问题