-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add React example to documentation #34
Comments
Hi there, firstly, my sincerest apologies for the late reply. We honestly just didn't see this issue somehow. We've made sure that won't happen again. As for your question... we do run the related content module in a React stack for our admin dashboard. Here's a gist of how it works: https://gist.github.com/nicc/4939de77fa8e4f6cc2892d76b9d36af5 Let me know if you have any further questions! All the best, |
Any extra movement on this issue? I am seeing React components in the readme but they are simply not working for me. I am building a site with NextJS and the component mentioed above and the ones in the readme are not pulling through any data. It is because I am working on Copy pasting the components from the exmaple above or the readme and it is printing to the DOM, but just not seeing any related items. And yes, there are plenty of related items in the content-items folder. When I view the content item browser, I see related items to a specific entry. And I am hard coding that entry to test that something will pull thru. Any help using React and NextJS would be appreciated. Thank you! |
@nicc's example is written in ES5 (May 2018). import {Bibblio} from 'bibblio-related-content-module'
import React, {useEffect, useState} from 'react'
export default function Recommendations({post}) {
const [mounted, setMounted] = useState(false)
useEffect(() => {
setMounted(true)
}, [])
if (mounted) {
Bibblio.initRelatedContent({
targetElementId: 'my-bibblio-container',
recommendationKey: 'your recommendation key',
customUniqueIdentifier: 'your custom unique identifier'
})
}
return (
<div>
<h1>Related Content</h1>
<div id="my-bibblio-container"></div>
</div>
)
} |
Bibblio looks really interesting! Adding an integration example for React would be very helpful for me to evaluate this for my company.
The text was updated successfully, but these errors were encountered: