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
fix: do not set a default id for Icon component #495
Conversation
Thanks for the pull request, @mtyaka! I've created OSPR-3744 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here. |
@mtyaka LGTM 👍 |
@mtyaka Thank you for your contribution. @edx/fedx-admin can you give this a look when you have a chance? |
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.
👍LGTM
@abutterworth Thank you. Good to merge or do you want another review from edX? |
@natabene I posted in Slack. I can merge this at the end of the day if no one brings up any concerns. |
Ports fix submitted in openedx#495 to the v3.8.0 version.
@mtyaka 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
🎉 This PR is included in version 6.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Thanks everyone! :) |
Setting the
id
property inIcon.defaultProps
tonewId('Icon')
makes every Icon that doesn't explicitly provide an id have an identical id property, sincenewId('Icon')
gets eveluated at module load time. Duplicateid
s are not valid HTML.We are already invoking
newId('Icon')
inside theIcon
component's render method if no id is provided, so we can safely set theid
indefaultProps
toundefined
and let the defaultid
get generated at render time.Testing instructions
<Icon>
components on a page. Notice that they all have the same id ('Span1'
).id
s are no longer identical.Reviewers: