Can I use Octomments in my React Application
Closed this issue · 4 comments
muco-rolle commented
Can I use Octomments in my React Application
krasimir commented
Hey, Octocomments is designed to work outside of the React context but sure you can write a component that initiates it. Something like that:
function Comments() {
useEffect(() => {
Octomments({
github: {
owner: 'krasimir',
repo: 'octomments',
},
issueNumber: 1,
renderer: [OctommentsRenderer, '#comments']
}).init();
}, []);
return <div id="comments"></div>;
}
The library should be added on the page + you have to be careful on re-rendering the Component
.
muco-rolle commented
Thank you @krasimir
muco-rolle commented
What is OctommentsRenderer reffered to?