ReactUse is a collection of React hooks (@reactuses/core). The website is built with Astro (packages/website-astro).
pnpm install # install dependencies
pnpm lint # eslint
pnpm test # vitestHook documentation pages follow the pattern: https://reactuse.com/{category}/{hookName}/
Categories: browser, effect, element, state, integrations
There is NO /docs/ or /hooks/ prefix. The URL is derived directly from the file path under packages/website-astro/src/content/docs/.
- Blog posts live in
packages/website-astro/src/content/blog/(English), with translations inblog-zh-hans/andblog-zh-hant/. - The legacy Docusaurus blog is at
packages/website-docusaurus/blog/.
When linking to hook documentation in blog posts, always use the hook registry at scripts/hook-registry.json as the source of truth for correct URLs.
Rules:
- Only link to hooks that exist in
hook-registry.json. Never invent hook names or guess URLs. - The URL format is
https://reactuse.com/{category}/{hookName}/— no/docs/or/hooks/prefix. - Each hook belongs to exactly one category. Do not guess categories — look them up.
After writing or editing a blog post, you must verify all hook links:
- Extract every
reactuse.comURL from the blog post. - For each URL, confirm the hook name and category exist in
scripts/hook-registry.json. - If a hook does not exist in the registry, either remove the link or replace it with an existing hook.
- Run this verification for all locale versions (en, zh-Hans, zh-Hant) of the post.
External platform copies are stored in blog-external/ with sequential numbering:
blog-external/
post-N-{slug}/
medium.md # English, no frontmatter (for Medium push skill)
devto.md # English, with dev.to frontmatter (published: false)
juejin.md # Chinese (simplified), no frontmatter (user copies manually)
After writing blog posts (3 locales in packages/website-astro/src/content/), always:
- Create
blog-external/post-N-{slug}/withmedium.md,devto.md,juejin.md - Only publish the first post of each batch to all 3 platforms:
- Medium: Use the
medium-pushskill with themedium.mdfile - dev.to: POST via API using
DEVTO_API_KEYfrom.env(setpublished: falseas draft) - Juejin (掘金): Tell user to copy from
juejin.md(no API available)
- Medium: Use the
- The remaining posts are saved in
blog-external/for future publishing
curl -s -X POST https://dev.to/api/articles \
-H "api-key: $DEVTO_API_KEY" \
-H "Content-Type: application/json" \
-d '{"article": {"title": "...", "body_markdown": "...", "published": false, "tags": ["react","javascript","webdev","tutorial"]}}'API key is in .env as DEVTO_API_KEY.