@ldhop/react
Version:
Follow your nose through linked data resources - for React
40 lines (28 loc) • 743 B
Markdown
with React
Install the package
```bash
yarn add @ldhop/react
npm install --save @ldhop/react
```
Install peer dependencies
```bash
yarn add react @tanstack/react-query
npm install --save react @tanstack/react-query
```
[ ](https://npmjs.com/package/@ldhop/core#query)
```ts
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
})
```
Follow your nose through linked data resources