反应错误:TypeError:无法读取未定义的属性“ toString”

时间:2020-04-29 11:56:22

标签: reactjs string post button window

我在响应中收到错误消息:

TypeError:无法读取未定义的属性“ toString”

与“ Deletehandler”相同的错误

如何解决此错误?

render() {
    return (
        <div className="post" id={this.props.id}>
            <div className="post-wrapper">
                <div className="delete-button"><a href="#" title="Delete this from history" onClick={this.props.args.deleteHandler}><i className="far fa-window-close"></i></a></div>
                <UserInfo userAvatar={this.props.args.avatar} date={this.props.args.date} username={this.props.args.nameLength} />
                <PostContent content={this.props.args.img} />
                <PostInfo likes={this.props.args.likes} views={this.props.args.views} commentsCount={this.props.args.commentsCount} likeHandler={this.props.args.likeHandler} isLiked={this.props.args.isLiked} showComments={this.showComments} />
                <Comments comments={this.props.args.comments} isExpanded={this.state.commentsExpanded} hideComment={this.hideComment} />
                <CommentInput addCommentHandler={this.addCommentDecorator} />
            </div>
        </div>
    );
}

0 个答案:

没有答案