-
Notifications
You must be signed in to change notification settings - Fork 28
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
replaced item id keys with uuid ones #822
replaced item id keys with uuid ones #822
Conversation
eaf7524
to
12b60bf
Compare
Force pushed to remove test case files that will be going in a separate draft PR. |
/> | ||
))} | ||
{contents.map((content, index) => { | ||
const uuid = uuidv4(); |
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.
Small readability improvement if you change the key to ch-content-${id}-${uuidv4()}
instead of having a variable you don't need the extra set of brackets and return
keyword for these components. Since we only call the function once, I think not having a variable is fine in this case.
@@ -1,5 +1,6 @@ | |||
import React from 'react'; | |||
import { CTFragment } from 'layout'; | |||
import { v4 as uuidv4 } from 'uuid'; |
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.
uuidv4 is totally a better name, nice pick!
@@ -24,7 +25,7 @@ let Tags = ({data, handleDelete}) => { | |||
} | |||
|
|||
return ( | |||
<Box style={boxstyle}> | |||
<Box style={boxstyle} data-testid="tag"> |
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.
maybe we can rename the test id to include the component name like "ChapterContent-test-tag" in the case we ever have a test with lots of different components?
Great PR! I've left some comments here and #823 |
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.
LGTM
Fixes #733