Skip to content

Docs/add documentation comments - #20

Merged
TheVolpeDev merged 6 commits into
devfrom
docs/add-documentation-comments
May 26, 2026
Merged

Docs/add documentation comments#20
TheVolpeDev merged 6 commits into
devfrom
docs/add-documentation-comments

Conversation

@TheVolpeDev

Copy link
Copy Markdown
Owner

This pull request adds clear JSDoc-style documentation to several core UI utility components, making it easier for developers to understand their purpose and usage. Each component now includes an example of how it should be used, improving maintainability and onboarding for new team members.

Component documentation improvements:

  • Added a detailed JSDoc comment to the For component in src/components/For.tsx, explaining its usage and providing an example.
  • Added a JSDoc comment to the Match component in src/components/Match.tsx, clarifying its intended use within Switch and providing an example.
  • Added a JSDoc comment to the Show component in src/components/Show.tsx, describing its conditional rendering behavior and including an example.
  • Added a JSDoc comment to the Switch component in src/components/Switch.tsx, explaining how it renders the first matching child and providing a usage example.

- Added JSDoc comments to the For component for better clarity.
- Included an example usage in the documentation.
- Added detailed documentation comments for the Match component.
- Included usage examples and remarks for better understanding.
- Added detailed documentation comments for the Show component.
- Included an example usage in the comments for clarity.
- Added JSDoc comments to describe the functionality of the Switch component.
- Included an example usage of the Switch component with Match children.
- Removed links from remarks for clarity
Copilot AI review requested due to automatic review settings May 26, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds JSDoc-style documentation blocks (with examples) to the library’s core React control-flow components to improve discoverability and onboarding.

Changes:

  • Documented Switch behavior and provided a usage example.
  • Documented Show conditional rendering behavior with a fallback example.
  • Documented For list rendering pattern with a render-function example.
  • Documented Match intended usage and added an example.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/components/Switch.tsx Adds component-level JSDoc describing first-truthy Match rendering with example.
src/components/Show.tsx Adds JSDoc describing conditional rendering with fallback and example.
src/components/Match.tsx Adds JSDoc with remarks and example (contains an internal contradiction to fix).
src/components/For.tsx Adds JSDoc describing list mapping via render function and example.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/Match.tsx Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@TheVolpeDev
TheVolpeDev merged commit 54be1e9 into dev May 26, 2026
1 check passed
@TheVolpeDev
TheVolpeDev deleted the docs/add-documentation-comments branch May 26, 2026 20:50
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