I want to use the following JQuery plugin as part of my React app, and haven’t had success in doing so: http://viima.github.io/jquery-comments/#link-3. This is a comments plugin that creates threads/replies.
Currently, I’ve tried to integrate it as follows, but to no avail:
import React, { Component } from "react";
import $ from "jquery";
import "./jquery-comments.css";
import "./jquery-comments";
class Comments extends Component {
componentDidMount() {
this.$el = $("#comments-container");
this.$el.comments({
profilePictureURL:
"https://viima-app.s3.amazonaws.com/media/public/defaults/user-icon.png",
getComments: function (success, error) {
var commentsArray = [
{
id: 1,
created: "2015-10-01",
content: "Lorem ipsum dolort sit amet",
fullname: "Simon Powell",
upvote_count: 2,
user_has_upvoted: false,
},
];
success(commentsArray);
},
});
}
render() {
return <div ref={(el) => (this.el = el)}></div>;
}
}
export default Comments;