-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Use React hooks for TabPanel component #22906
Use React hooks for TabPanel component #22906
Conversation
@pkvillanueva Thank you so much for contributing 🎉 ! I tested this locally, and it looks like it's working as expected 🙌 |
@pkvillanueva I tested it out again. Looks like it's working :) I took a closer look at the HTML, and the generated ID looked strange (screenshot below). It started with a number 🤔 . This isn't your fault! It must have always been like this 🤦♀️ . I checked the HTML specs. Ids must start with a letter. We updated const instanceId = useInstanceId( TabPanel, 'tab-panel' ); Then the generated ids should look like That feels much better to me 😊 |
@ItsJonQ You are right. I noticed that some other components use this hook without prefix. |
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.
Looks good to merge. There are some failing end-to-end tests, but they appear to just be intermittent failures. I can't seem to restart the tests. Try rebasing the branch, which should trigger the automated tests to run again.
Congratulations on your first merged pull request, @pkvillanueva! We'd like to credit you for your contribution in the post announcing the next WordPress release, but we can't find a WordPress.org profile associated with your GitHub account. When you have a moment, visit the following URL and click "link your GitHub account" under "GitHub Username" to link your accounts: https://profiles.wordpress.org/me/profile/edit/ And if you don't have a WordPress.org account, you can create one on this page: https://login.wordpress.org/register Kudos! |
@pkvillanueva @ZebulanStanphill Hey! Now that you moved component to use |
@outcomer It's really hard to understand your issue without actually seeing your code, but it sounds to me like whatever you were doing before was implemented in a rather hacky/fragile way that relied too much on specific implementation details, and therefore was liable to break at any time. I suspect there's a better way to do what you want that would work both before and after the changes in this PR, but again, without seeing your code it's very difficult to know for sure. Unfortunately, I found your textual explanation very difficult to follow. Perhaps you should ask for help in the Developing with WordPress Forum or StackOverflow. (And make sure to share your code there, so people can see what you're trying to do.) If you find that there's no non-hacky way to do what you want, then open an issue here specifying what kind of extensibility or new APIs you'd like to see introduced. But at least right now, it looks to me like this pull request has not changed anything in the public API of the |
Description
Related to #22890
How has this been tested?
The TabPanel component is used in two places:
Checklist: