Skip to content
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

Warning: A props object containing a "key" prop is being spread into JSX #1889

Merged
merged 1 commit into from
Feb 8, 2025

Conversation

crazy-poncho
Copy link
Contributor

Status

READY

Description

When you start docs locally, you could see this warning log:

Warning: A props object containing a "key" prop is being spread into JSX:
  let props = {key: someKey, className: ..., children: ..., style: ...};
  <span {...props} />
React keys must be passed directly to JSX without using spread:
  let props = {className: ..., children: ..., style: ...};
  <span key={someKey} {...props} />
    at Highlight (…/orval/docs/node_modules/prism-react-renderer/dist/index.cjs.js:198:15)
    at Code (webpack-internal:///./src/components/Highlight.js:30:17)
    at div
    at div
    at section
    at div
    at Home (webpack-internal:///./src/pages/index.js:43:13)
    at SearchProvider (webpack-internal:///./src/components/useSearch.js:32:27)
    at Hydrate (file:///.../orval/docs/node_modules/@tanstack/react-query/build/lib/Hydrate.mjs:23:3)
    at QueryClientProvider (file:///.../orval/docs/node_modules/@tanstack/react-query/build/lib/QueryClientProvider.mjs:41:3)
    at MyApp (webpack-internal:///./src/pages/_app.js:27:18)
    at StyleRegistry (/.../orval/docs/node_modules/styled-jsx/dist/index/index.js:449:36)
    at PathnameContextProviderAdapter (/.../orval/docs/node_modules/next/dist/shared/lib/router/adapters.js:78:11)
    at AppContainer (/.../orval/docs/node_modules/next/dist/server/render.js:337:29)
    at AppContainerWithIsomorphicFiberStructure (/.../orval/docs/node_modules/next/dist/server/render.js:373:57)
    at div
    at Body (/.../orval/docs/node_modules/next/dist/server/render.js:673:21)

Steps to Test or Reproduce

  1. Run docs locally
  2. Go to home page (localhost:3000)
  3. Watch log in dev tools / terminal

@crazy-poncho crazy-poncho changed the title fix: remove warning log Warning: A props object containing a "key" prop is being spread into JSX Feb 8, 2025
@melloware melloware added the documentation Improvements or additions to documentation label Feb 8, 2025
@melloware melloware merged commit 97141ba into orval-labs:master Feb 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants