Skip to content

docs(useCounter): mark options as optional - #551

Open
theluckystrike wants to merge 1 commit into
toss:mainfrom
theluckystrike:docs/use-counter-optional-options
Open

theluckystrike wants to merge 1 commit into
toss:mainfrom
theluckystrike:docs/use-counter-optional-options

Conversation

@theluckystrike

Copy link
Copy Markdown
Contributor

Overview

useCounter defaults its second argument to {}:

export function useCounter(initialValue = 0, { min, max, step = 1 }: UseCounterOptions = {})

The JSDoc listed options without brackets, so the generated API page shows options: UseCounterOptions with a required badge. The spec already calls useCounter() with no arguments.

This PR changes the tag to [options], regenerates the English page with yarn docs:gen useCounter and the skill reference with yarn skill:gen, and makes the same two edits by hand in the ko, ja, zh-Hans and es pages. It also adds a patch changeset, like #509 did for its JSDoc changes.

Only useCounter is touched. useMap has the same issue with initialValue, but #532 is changing that file, so I left it out.

Checklist

  • Did you write the test code? (docs only, the existing useCounter spec passes: 11 tests)
  • Have you run yarn run fix to format and lint the code and docs? (prettier check passes on the changed files)
  • Have you run yarn run test:coverage to make sure there is no uncovered line? (no code change)
  • Did you write the JSDoc?

yarn test:docs and yarn test:skill pass locally.

useCounter defaults options to {}, but the JSDoc listed it as a
required parameter, so the API pages and the agent skill showed
`options: UseCounterOptions` with a required badge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 3, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a4c64ce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
react-simplikit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a8c44e8) to head (a4c64ce).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #551   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           69        69           
  Lines         2280      2280           
  Branches       737       737           
=========================================
  Hits          2280      2280           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants