Docs/add documentation comments - #20
Merged
Merged
Conversation
- 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
Contributor
There was a problem hiding this comment.
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
Switchbehavior and provided a usage example. - Documented
Showconditional rendering behavior with a fallback example. - Documented
Forlist rendering pattern with a render-function example. - Documented
Matchintended 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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Forcomponent insrc/components/For.tsx, explaining its usage and providing an example.Matchcomponent insrc/components/Match.tsx, clarifying its intended use withinSwitchand providing an example.Showcomponent insrc/components/Show.tsx, describing its conditional rendering behavior and including an example.Switchcomponent insrc/components/Switch.tsx, explaining how it renders the first matching child and providing a usage example.