docs: update React hooks guide to @capawesome/capacitor-react-hooks - #604
docs: update React hooks guide to @capawesome/capacitor-react-hooks#604robingenz wants to merge 2 commits into
Conversation
|
@robingenz is attempting to deploy a commit to the Ionic Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Updates the Capacitor React Hooks guide to reference @capawesome/capacitor-react-hooks (instead of the unmaintained @capacitor-community/react-hooks) and refreshes examples/wording to align with Capacitor v8+ usage and the new package’s design goals.
Changes:
- Switch installation and “More Reading” references to
@capawesome/capacitor-react-hooks. - Replace the old Filesystem-based sample with updated Network and Geolocation hook examples.
- Document key behavioral guarantees (shared listeners, StrictMode-safe cleanup, launch events, SSR-safety, bundle sizing).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| versioned_docs/version-v8/main/guides/react-hooks.md | Updates the v8 guide to point at @capawesome/capacitor-react-hooks with new examples and updated rationale. |
| docs/main/guides/react-hooks.md | Applies the same guide updates to the main docs version. |
Suppressed comments (2)
versioned_docs/version-v8/main/guides/react-hooks.md:59
- Minor grammar: “server rendered” is typically hyphenated when used adjectivally.
- **SSR support**: no module touches a browser API at import time, which keeps imports safe in server rendered setups.
docs/main/guides/react-hooks.md:59
- Minor grammar: “server rendered” is typically hyphenated when used adjectivally.
- **SSR support**: no module touches a browser API at import time, which keeps imports safe in server rendered setups.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Labeeb2339
left a comment
There was a problem hiding this comment.
I reviewed both the main and v8 guide updates. The installation package, subpath imports, optional peer-dependency note, and examples are consistent across the two copies, and the old FilesystemDirectory example is removed. The change is scoped to the stale guide and I found no additional correctness issue in the diff.
@capacitor-community/react-hookshasn't had a release since 0.0.11 in July 2020 and the repo has been untouched since February 2023. Its peer dependencies are still@capacitor/core@^2.0.0andreact@^16.8.6, and the example on this page usesFilesystemDirectory, which was renamed in Capacitor 3. The sample doesn't compile either. So the guide currently sends people on v8 to a dead end.This points the guide at
@capawesome/capacitor-react-hooksand rewrites the examples against it.Apart from being actively maintained, the things that matter most in practice:
addListenerbefore removing the handle, so StrictMode's double render doesn't leave listeners behind.I applied the same change to
docs/main(v9) since that file was identical. The older versioned docs are left as they are, since the package requires Capacitor 8.Happy to trim the v9 part or reword anything.