{"id":19706450,"url":"https://github.com/superioone/pnp-react-hooks","last_synced_at":"2025-04-29T16:33:22.151Z","repository":{"id":57326496,"uuid":"411020941","full_name":"SuperioOne/pnp-react-hooks","owner":"SuperioOne","description":"Pre-built React hooks for Pnp requests.","archived":false,"fork":false,"pushed_at":"2025-02-10T15:48:38.000Z","size":10044,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-24T12:52:05.207Z","etag":null,"topics":["pnp","react-hook","sharepoint"],"latest_commit_sha":null,"homepage":"https://prh.smdd.dev","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SuperioOne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-27T19:42:47.000Z","updated_at":"2025-02-10T15:45:07.000Z","dependencies_parsed_at":"2024-05-30T03:09:08.078Z","dependency_job_id":"83e0b89f-a1a8-48d8-afa1-231951fe4b4e","html_url":"https://github.com/SuperioOne/pnp-react-hooks","commit_stats":{"total_commits":146,"total_committers":1,"mean_commits":146.0,"dds":0.0,"last_synced_commit":"ee4a5e25a8cdb5ce4f23bdf2b9c5cc499d4c48b9"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperioOne%2Fpnp-react-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperioOne%2Fpnp-react-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperioOne%2Fpnp-react-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SuperioOne%2Fpnp-react-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SuperioOne","download_url":"https://codeload.github.com/SuperioOne/pnp-react-hooks/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251540517,"owners_count":21605915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pnp","react-hook","sharepoint"],"created_at":"2024-11-11T21:35:34.755Z","updated_at":"2025-04-29T16:33:17.135Z","avatar_url":"https://github.com/SuperioOne.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PnP React Hooks\n\nPnP React Hooks is a wrapper library for [PnPjs](https://pnp.github.io/pnpjs/), \nprovides configurable React hooks for SharePoint API to speed up \ndevelopment for simple SPFx webparts and components.\n\n**Example usage:**\n\n```jsx\nimport * as React from \"react\";\nimport { useListItems, useCurrentUser } from \"pnp-react-hooks\";\n\nexport const ExampleComponent = () =\u003e {\n\tconst currentUser = useCurrentUser();\n\n\tconst items = useListItems(\"My List\", {\n\t\tquery: {\n\t\t\tselect: [\"Title\", \"Id\", \"Author/Title\"],\n\t\t\texpand: [\"Author\"],\n\t\t\tfilter: `Author eq ${currentUser?.Id}`\n\t\t},\n\t\tdisabled: !currentUser\n\t});\n\n\treturn (\u003cul\u003e\n\t\t{items?.map(item =\u003e (\u003cli key={item.Id}\u003e{item.Title}\u003c/li\u003e))}\n\t\u003c/ul\u003e);\n};\n```\n\n## Installation\n\n```shell\nnpm install pnp-react-hooks @pnp/sp react\n```\n\n`@pnp/sp` and `react` packages are peer dependencies.\n\n| Peer dependency  | Supported versions   |\n|------------------|----------------------|\n| `@pnp/sp`        | 4.1.0 or later       |\n| `react`          | 16.9.\\* to 18.\\*.\\*  |\n\n## Features\n\n- Build simple web parts quickly with less code.\n- TypeScript support.\n- Automatically tracks parameter changes and refreshes data as needed.\n- Easy to tree-shake unused code with modern JS bundlers.\n- Can be configured for multiple sites with an option provider.\n- Supports [PnPjs behaviors](https://pnp.github.io/pnpjs/core/behaviors/).\n\n## Documentation\n\nFor more details see the [docs site](https://prh.smdd.dev).\n\n## Disclaimer\n\n**PnP React Hooks library is an open source project under MIT license. It's NOT an official package distributed by Microsoft.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperioone%2Fpnp-react-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperioone%2Fpnp-react-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperioone%2Fpnp-react-hooks/lists"}