Contributing
We welcome contributions to hooks, tests, and docs.
The project is open to both small fixes and larger feature proposals. If you are not sure where to start, improving docs examples or test quality is always a valuable contribution.
Local workflow
bash
npm install
npm run test
npm run lintBefore opening a PR
- Confirm behavior in a realistic usage example.
- Check that docs snippets compile conceptually and match current API.
- Keep each PR focused on one unit of change (hook, docs section, or infra improvement).
Pull request checklist
- Keep scope focused.
- Add tests for behavior changes.
- Update docs page for changed hook APIs.
- Use clear Conventional Commit messages.
Documentation site: new or renamed hooks
The Functions sidebar and the home page category grid both read from a single catalog:
docs/.vitepress/data/hookCatalog.ts- add the hook under the right category (links andsidebarCollapsedfor the group).docs/ssr-support.json- settruewhen the hook is safe withwindow/documentabsent, otherwisefalse.- Add new guide pages under
docs/guide/and register them indocs/.vitepress/config.mts(sidebaritemsand optionalinject-seo.mjsguideDescriptionsentry fordocs:seo). - Regenerate bundle size data with
npm run docs:build(runsexport-sizefirst) when@dedalik/use-reactexports change.
SEO and sitemap
- Page titles use
titleTemplateindocs/.vitepress/config.mts(:title | useReact). SettitleTemplate: falseon a page when the title is already complete (for example the home page). - Run
npm run docs:seoto (re)filldescriptionin Markdown from templates. After large edits runnode utils/inject-seo.mjs --forceso every doc page gets a fresh meta description. The home pagedocs/index.mdis skipped so its frontmatter stays hand-tuned. - Per-page
<link rel="canonical">, robots, author, publisher,og:url, and JSON-LD (Organization,WebSite,WebPage) are injected at build time viatransformHeadindocs/.vitepress/config.mtsanddocs/.vitepress/seo/transformHead.ts. SetSITE_URLso canonicals match production (same variable as the sitemap script). npm run docs:buildwritesdocs/.vitepress/dist/sitemap.xml. Override the public URL withSITE_URL=https://your.domainwhen the production host is not the default.docs/public/robots.txtpoints crawlers athttps://usereact.org/sitemap.xml- update the domain there if it changes.
Writing high-signal PR descriptions
Include:
- the problem being solved,
- why this approach was selected,
- how reviewers can verify behavior quickly.