-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
Conversation
59e07d5
to
e9fee0a
Compare
/** | ||
* 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 }) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome
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.