Closed muco-rolle closed 3 years ago
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.
Component
Thank you @krasimir
What is OctommentsRenderer reffered to?
The renderer is a part of Octomments that is responsible for the UI. I split the core functionality and the visual bit to allow the consumers of the library to have different design.
Hey, Octocomments is designed to work outside of the React context but sure you can write a component that initiates it. Something like that:
The library should be added on the page + you have to be careful on re-rendering the
Component
.