Skip to content

fix: add keys to createCtas elements #4362

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

Merged
merged 2 commits into from
Oct 4, 2022
Merged

fix: add keys to createCtas elements #4362

merged 2 commits into from
Oct 4, 2022

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Oct 4, 2022

No description provided.

@jsjoeio jsjoeio requested a review from a team as a code owner October 4, 2022 16:36
@jsjoeio jsjoeio requested review from presleyp and removed request for a team October 4, 2022 16:36
// REMARK: we don't have to worry about key order changing
// eslint-disable-next-line react/jsx-key
return [<CopyStackButton text={codeBlock.join("\r\n")} />, <ReloadAppButton />]
return [<CopyStackButton key="copy-stack-btn" text={codeBlock.join("\r\n")} />, <ReloadAppButton key="reload-app-btn" />]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I know it says they won't change but I decided to add them because:

  • no negative impact adding them
  • good codebase hygiene to avoid using eslint-disable

Plus, in some edge case if React does render them in a different order, it can tell the difference based on key.

@jsjoeio jsjoeio self-assigned this Oct 4, 2022
@jsjoeio
Copy link
Contributor Author

jsjoeio commented Oct 4, 2022

Fixing formatting right now

@jsjoeio jsjoeio enabled auto-merge (squash) October 4, 2022 16:40
@jsjoeio jsjoeio merged commit 78283cf into main Oct 4, 2022
@jsjoeio jsjoeio deleted the jsjoeio/fix-createCtas branch October 4, 2022 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants