Skip to content

fix: handle React key prop correctly#1645

Open
Sbragul26 wants to merge 2 commits into
layer5io:masterfrom
Sbragul26:fix/usersearchfield-react-warning
Open

fix: handle React key prop correctly#1645
Sbragul26 wants to merge 2 commits into
layer5io:masterfrom
Sbragul26:fix/usersearchfield-react-warning

Conversation

@Sbragul26

Copy link
Copy Markdown
Member

Notes for Reviewers

This PR fixes #1644
It removes the React warning caused by spreading the key prop into JSX and passes the key prop correctly.
Signed commits

  • Yes, I signed my commits.

Signed-off-by: Sbragul26 <sbragul26@gmail.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the renderOption prop in UserSearchFieldInput.tsx to destructure and apply the key prop to the list item element. The reviewer identified that destructuring key directly from props will trigger a TypeScript compilation error since key is not defined on React.HTMLAttributes<HTMLLIElement>. To resolve this, the reviewer suggested casting the props to include key and maintaining the original implicit return structure to prevent indentation and syntax issues.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/custom/UserSearchField/UserSearchFieldInput.tsx Outdated
Comment thread src/custom/UserSearchField/UserSearchFieldInput.tsx Outdated
Signed-off-by: Sbragul26 <sbragul26@gmail.com>
@Sbragul26

Copy link
Copy Markdown
Member Author

Preview

GitHub Local

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.

[Bug] React key prop warning in UserSearchFieldInput

1 participant