Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Rewrite Refs doc #1212

Merged
merged 8 commits into from
Dec 25, 2024
Merged

refactor: Rewrite Refs doc #1212

merged 8 commits into from
Dec 25, 2024

Conversation

rschristian
Copy link
Member

@rschristian rschristian commented Dec 24, 2024

I've found the refs doc rather lacking for a while, hope this is an improvement. Notably, it adds hooks examples, mentions values other than DOM nodes, and mentions the new cleanup functions added in 10.23.

Should address #1001 too, I expanded the warning for the callback refs section to (hopefully) clarify that a bit better.

Edit: Will try to do something similar to the Context doc, either during more gaps in holiday celebrations or in the next couple of weeks.

Comment on lines +5 to +17
/**
* Used in markdown files to switch between different API styles, i.e,
* Class Components and Hooks. This displays either-or, not both at once,
* so it's not necessarily meant for directly comparing API styles.
*
* Primarily adopted from MDN's tabs example:
* https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/tab_role#example
*
* @param {Object} props
* @param {string} props.tabstring - Comma-separated list of tab names
* @param {Array<import('preact').Component | string>} props.children - Array of JSX elements
*/
export default function TabGroup({ tabstring, children }) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm super pleased with this (almost unreasonably so), should be great for showing off different API styles/options in the future.

As noted, MDN has a brilliant tutorial in which they go over all of the accessibility complexities which I believe I mirrored correctly. Everything seems to be labeled, connected, and following practices as intended.

@rschristian rschristian marked this pull request as ready for review December 24, 2024 23:01
Copy link
Member

@JoviDeCroock JoviDeCroock left a comment

Choose a reason for hiding this comment

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

This is awesome

@rschristian rschristian merged commit 89b6432 into master Dec 25, 2024
5 checks passed
@rschristian rschristian deleted the refactor/reword-refs branch December 25, 2024 23:31
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