Skip to content
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 React warning with data attributes #1841

Merged
merged 2 commits into from
Jan 7, 2022
Merged

Fix React warning with data attributes #1841

merged 2 commits into from
Jan 7, 2022

Conversation

Tbaut
Copy link
Collaborator

@Tbaut Tbaut commented Jan 5, 2022

Something I missed, thanks @tanmoyAtb: React doesn't like having camelCase for data attributes somehow.

So we'll have to live with data-testid all lower case, still more consistent than before.

image

@render
Copy link

render bot commented Jan 5, 2022

@render
Copy link

render bot commented Jan 5, 2022

@render
Copy link

render bot commented Jan 5, 2022

@Tbaut Tbaut changed the title Testid to consistency, lower case Fix React warning with data attributes Jan 5, 2022
@Tbaut Tbaut requested a review from FSM1 January 5, 2022 17:52
@@ -356,7 +356,7 @@ const Button: React.FC<IButtonProps> = ({
)}
disabled={disabled || loading}
{...rest}
data-testId={`button-${testId}`}
data-testid={`button-${testId}`}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should all the ${testId} references be updated too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no I think it's ok because that's a prop in a component that doesn't end up as an html attribute. The problem from the warning is that the prop was directly translated as html, and html attributes should not have camelCase

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok! Thanks for the explanation :)

@Tbaut Tbaut requested a review from asnaith January 6, 2022 10:49
@Tbaut Tbaut added Status: Review Needed 👀 Added to PRs when they need more review Type: Maintenance Added to issues and PRs when a change is for repository maintenance , such as CI or linter changes. labels Jan 6, 2022
@Tbaut Tbaut merged commit a32086c into dev Jan 7, 2022
@Tbaut Tbaut deleted the tbaut-tesstid-lower branch January 7, 2022 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed 👀 Added to PRs when they need more review Type: Maintenance Added to issues and PRs when a change is for repository maintenance , such as CI or linter changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants