-
Notifications
You must be signed in to change notification settings - Fork 81
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: Use JSX.ImplicitElements to derive valid property names #267
Conversation
ac5445e
to
00736d5
Compare
@@ -19,7 +19,7 @@ export const MegaMenu = ( | |||
<div className="grid-row grid-gap-4"> | |||
{items.map((listItems, i) => ( | |||
<div className="usa-col" key={`subnav_col_${i}`}> | |||
<NavList items={listItems} type="megamenu" {...ulProps} /> | |||
<NavList items={listItems} megamenu={true} {...navListProps} /> |
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.
suggestion: for megamenu={true}
and I think I saw this one other place. Leave off the attribute assignment when its true.
Just by including the name of the attribute on the element it is by default true.
data-testid="tag" | ||
className={tagClasses} | ||
style={{ ...style }} | ||
{...spanProps}> |
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.
Thanks for catching stuff like this, I think I saw a couple other places where this rewrite was also nice little cleanup for us. Also like how you standardized the way we name props -CustomProps
etc.
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 seems to work! I kept trying JSX.IntrinsicElements.form
earlier and that was not working haha didn't even try bracket notation. Would like @suzubara to also take a look before we merge.
Also random FYI when you use [WIP] the PR title linter will pass.
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 me! Just need to take [WIP] out of the PR title and make it match the semantic changelog format.
Ok! Should I create a corresponding issue about it? Is this a bugfix or a feature? |
* Use JSX.ImplicitElements to derive valid property names * Use name of attribute only when value is true
* Use JSX.ImplicitElements to derive valid property names * Use name of attribute only when value is true
* Use JSX.ImplicitElements to derive valid property names * Use name of attribute only when value is true
Summary
Use the proper react types to indicate which props are allowed on components.
Related Issues or PRs
This was found as part of exploration for #161
How To Test
This should not change functionality other than allowing the proper attributes