Skip to content

docs(hooks): updated hooks docs#2683

Open
Johudo wants to merge 1 commit into
mainfrom
docs/hooks
Open

docs(hooks): updated hooks docs#2683
Johudo wants to merge 1 commit into
mainfrom
docs/hooks

Conversation

@Johudo
Copy link
Copy Markdown
Contributor

@Johudo Johudo commented May 20, 2026

Summary by Sourcery

Update hook documentation to reflect current APIs and callback signatures.

Documentation:

  • Document new useSelect props for disabling selection and close events, and update the listed return values to match the current hook API.
  • Clarify the useOutsideClick handler type to include MouseEvent and TouchEvent parameters.
  • Adjust useIntersection documentation to describe the observed element type as Element | null instead of a React ref.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented May 20, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates documentation for several React hooks to reflect new or clarified API contracts, including new props, updated return values, and more specific type signatures.

File-Level Changes

Change Details Files
Document new and updated API surface for useSelect hook.
  • Add documentation for new disabled and onClose props in the useSelect props table.
  • Update the result section to include setValue and handleClearValue and to describe handleSelection, toggleOpen, and activeIndex-related values more clearly.
  • Remove deprecated setOpen from the documented return values and adjust ordering of documented fields.
src/hooks/useSelect/README.md
Clarify the handler type and ref type in useOutsideClick documentation.
  • Change handler type to accept MouseEvent or TouchEvent as an argument.
  • Reformat the properties table to accommodate the more complex handler type signature while preserving meaning of ref prop.
src/hooks/useOutsideClick/README.md
Clarify observed element type in useIntersection documentation.
  • Update element prop type from React.RefObject to Element
null to match actual usage.
  • Keep options and onIntersect documentation unchanged while aligning the type information with implementation.

  • Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

    Copy link
    Copy Markdown
    Contributor

    @sourcery-ai sourcery-ai Bot left a comment

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    Hey - I've found 1 issue

    Prompt for AI Agents
    Please address the comments from this code review:
    
    ## Individual Comments
    
    ### Comment 1
    <location path="src/hooks/useSelect/README.md" line_range="38" />
    <code_context>
    +| activeIndex      | Index of active option                |  `number`  |
    +| setActiveIndex   | Sets value for `activeIndex` property | `function` |
    +| handleSelection  | Handles item selection                | `function` |
    +| handleClearValue | Clears selected value                 | `function` |
    </code_context>
    <issue_to_address>
    **nitpick (typo):** Pluralize "value" to match the documented array type.
    
    Given `value` is a `string[]`, consider phrasing this as "Clears selected values" or "Clears the selected values" to reflect that it operates on multiple items.
    </issue_to_address>

    Sourcery is free for open source - if you like our reviews please consider sharing them ✨
    Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

    Comment thread src/hooks/useSelect/README.md Outdated
    @gravity-ui
    Copy link
    Copy Markdown
    Contributor

    gravity-ui Bot commented May 20, 2026

    Preview is ready.

    @gravity-ui
    Copy link
    Copy Markdown
    Contributor

    gravity-ui Bot commented May 20, 2026

    🎭 Component Tests Report is ready.

    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