Follow your nose through linked data resources with React
Install the package
yarn add @ldhop/react
# or
npm install --save @ldhop/react
Install peer dependencies
yarn add react @tanstack/react-query
# or
npm install --save react @tanstack/react-query
Learn how to write a LDhop query
import { useLDhopQuery } from '@ldhop/react'
const query: RdfQuery = [
// ... the query
]
const { isLoading, variables, quads } = useLDhopQuery({
query, // LDhop query
variables: useMemo(() => ({ person: [webId] }), [webId]), // starting points (memoized)
fetch, // default or custom fetch, perhaps authenticated
})