Skip to content

fix: prevent key from being spread#51

Open
layaxx wants to merge 1 commit intobmartel:mainfrom
layaxx:patch-key-spread
Open

fix: prevent key from being spread#51
layaxx wants to merge 1 commit intobmartel:mainfrom
layaxx:patch-key-spread

Conversation

@layaxx
Copy link

@layaxx layaxx commented Aug 19, 2025

This fixes the following Error/Warning that I encountered with react@18.3.1:

A props object containing a "key" prop is being spread into JSX:
  let props = {key: someKey, value: ..., label: ..., selected: ..., created: ..., index: ..., style: ...};
  <SelectOptionItem {...props} />
React keys must be passed directly to JSX without using spread:
  let props = {value: ..., label: ..., selected: ..., created: ..., index: ..., style: ...};
  <SelectOptionItem key={someKey} {...props} /> 

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

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.

1 participant