-
Notifications
You must be signed in to change notification settings - Fork 56
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
Usage of title
via prop drilling not detected
#467
Comments
This could be challenging because the |
Agreed, maybe another approach could be to throw warning on usage of |
cc. @TylerJDev I wonder if we can just omit the title props from this Primer component? |
@kendallgassner, In this example yeah! I think that the title prop should be removed from <button title="Passed text" ...>
<span>Edit Passed Text</span>
</button> We'd definitely want to remove it in this instance. I don't think this is tied to Primer though. I'm wondering, is this a shared component? |
This particular instance was already fixed in https://github.com/github/github/pull/281501 ✅
|
In this particular case I think cleaning up the Props and removing @andrefcdias do you feel like removing the hardcoded prop from the |
That and the awareness raised within my team should be more than enough because we own the component in question and the shared component that uses it. My original concern was more about this scenario being a possibility, which can go under the radar as it is not direct I also like the idea of either omitting |
@TylerJDev thoughts here? We have some Primer components that use the prop name |
FYI, I've also seen this happen in some of the shared components |
Definitely agree, I think it'd be beneficial for us to steer away from using HTML attributes as prop names when there's no direct connection. This would involve a breaking change for most components that currently do this, but I'd like to get the idea out there.
We could have a lint rule specific to Primer components in @kendallgassner, I forget if this was discussed already. Do you think this should be something |
If we add the lint rule in Thinking 🤔 though we would need to account for the |
If we did test Primer specific components, would we want to ignore |
And I can't think of a case where we would want a Primer component with |
Revisiting this discussion... @TylerJDev I 100% agree and would fully support this! Is there a tracking issue or discussion I could reference? :) |
Agreed, maybe another approach 🧛🏻 |
Recently found a couple of cases of
title
attribute usage (soon to be addressed in https://github.com/github/issues/issues/7066 🙏) that are not detected by the rule.This seems to be the case when prop drilling
title
into a component, unsure if because this specific scenario is overriding the type prop or something else.Root usage of the attribute
Props object with the
title
prop being spread into a buttonProp type overriding
title
The text was updated successfully, but these errors were encountered: