-
Notifications
You must be signed in to change notification settings - Fork 68
LG-4899: getLgIds #2786
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?
LG-4899: getLgIds #2786
Conversation
🦋 Changeset detectedLatest commit: c195e3a The changes in this PR will be included in the next version bump. This PR includes changesets to release 83 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Change: +1.93 kB (+0.1%) Total Size: 1.86 MB
ℹ️ View Unchanged
|
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.
Noticed 2 common nits:
- Default value set twice
- Calling
useMemo
ongetLgids()
. Not sure that's necessary (were you noticing issues without it?)
@@ -26,7 +26,7 @@ describe('CopyButton', () => { | |||
return render( | |||
<CodeContextProvider | |||
// @ts-expect-error - other ids are missing but not needed for test | |||
lgids={{ | |||
lgIds={{ |
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.
Is this testing that a copyButton
with a non-default id can still be queried?
export const DEFAULT_LGID_ROOT = 'lg-button'; | ||
|
||
export const getLgIds = (root: `lg-${string}` = DEFAULT_LGID_ROOT) => { | ||
export const getLgIds = (root: LgIdString = DEFAULT_LGID_ROOT) => { |
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.
Not necessary here, but it might be worth creating a GetLgIdsFunction
function type, and maybe a return type?
type GetLgIdsFunction = (root?: LgIdString) => {
root: LgIdString,
...
}
@shaneeza this should be good to go |
✍️ Proposed changes
🎟 Jira ticket: Name of ticket
✅ Checklist
For bug fixes, new features & breaking changes
pnpm changeset
and documented my changesFor new components
🧪 How to test changes