Skip to content

Conversation

@mlazari
Copy link
Contributor

@mlazari mlazari commented Oct 9, 2024

When using version 18.3.0 of "react" there is a warning saying that react keys must be passed directly to JSX without using spread (added in facebook/react#25697):

 ERROR  Warning: A props object containing a "key" prop is being spread into JSX:
  let props = {key: someKey, postprocessValue: ..., hideRoot: ..., shouldExpandNode: ..., collectionLimit: ..., sortObjectKeys: ..., getItemString: ..., keyPath: ..., labelRenderer: ..., nodeType: ..., styling: ..., value: ..., valueRenderer: ..., data: ..., isCustomNode: ...};
  <JSONObjectNode {...props} />
React keys must be passed directly to JSX without using spread:
  let props = {postprocessValue: ..., hideRoot: ..., shouldExpandNode: ..., collectionLimit: ..., sortObjectKeys: ..., getItemString: ..., keyPath: ..., labelRenderer: ..., nodeType: ..., styling: ..., value: ..., valueRenderer: ..., data: ..., isCustomNode: ...};
  <JSONObjectNode key={someKey} {...props} />
    in JSONNode (created by JSONTree)

When using version 18.3.0 of "react" there is a warning saying that react keys must be passed directly to JSX without using spread (added in facebook/react#25697):

```
 ERROR  Warning: A props object containing a "key" prop is being spread into JSX:
  let props = {key: someKey, postprocessValue: ..., hideRoot: ..., shouldExpandNode: ..., collectionLimit: ..., sortObjectKeys: ..., getItemString: ..., keyPath: ..., labelRenderer: ..., nodeType: ..., styling: ..., value: ..., valueRenderer: ..., data: ..., isCustomNode: ...};
  <JSONObjectNode {...props} />
React keys must be passed directly to JSX without using spread:
  let props = {postprocessValue: ..., hideRoot: ..., shouldExpandNode: ..., collectionLimit: ..., sortObjectKeys: ..., getItemString: ..., keyPath: ..., labelRenderer: ..., nodeType: ..., styling: ..., value: ..., valueRenderer: ..., data: ..., isCustomNode: ...};
  <JSONObjectNode key={someKey} {...props} />
    in JSONNode (created by JSONTree)
```
@Dean177
Copy link
Owner

Dean177 commented Oct 9, 2024

Thanks!

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