-
Notifications
You must be signed in to change notification settings - Fork 95
refactor: Introduce 'id' prop on <Tooltip> #2562
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
base: main
Are you sure you want to change the base?
refactor: Introduce 'id' prop on <Tooltip> #2562
Conversation
BREAKING CHANGE: This commit introduces a required 'id' property on the <Tooltip> component which replaces the random automatcially generated one used previously.
@ClayBenson94 Hey - that use case makes a lot sense to me! In terms of implementation - can we surface the |
@ClayBenson94 do you have some time to make the change Hana suggested? ☝️ |
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.
lookin good from design standpoint
This |
@ClayBenson94 please take a look at @mcmcgrath13's solution in #3094. That solution would be a non-breaking change, which makes it easier to include. And if you would still like to see an optional Id prop added, I think that would be a fine addition as well, but would recommend including it on #3094 |
Based on #3096, it sounds like adding an optional id prop would be the next improvement to make. We can update this PR to include an optional id prop OR close this PR and create an issue for the optional prop |
Summary
This commit introduces a required 'id' property on the
component which replaces the random automatically generated one used previously.
Our application creates snapshot tests using
jest-snapshot
, and the randomly-generated IDs that come from this component make the snapshots no longer deterministic (and would fail on each run).This PR is an attempt to address that. I can't say I'm in love with this solution as it does introduce a breaking change that would require IDs to be placed on
<Tooltip>
components across the board, so I am open to other solutions as well!Related Issues or PRs
How To Test
Screenshots (optional)