Skip to content

Conversation

@rjwills28
Copy link
Collaborator

We are getting warnings in the tests when a widget is undefined:

Warning: Each child in a list should have a unique "key" prop.

Check the render method of `EmbeddedDisplay`. See https://reactjs.org/link/warning-keys for more information.
    at Label
    at EmbeddedDisplay (/home/rjaw/cs-web/cs-web-proto/node_modules/@diamondlightsource/cs-web-lib/dist/cjs/index.js:9941:42)
    at LoadEmbedded (/home/rjaw/cs-web/cs-web-proto/src/app.tsx:33:39)
    at Route (/home/rjaw/cs-web/cs-web-proto/node_modules/react-router/cjs/react-router.js:664:29)
    at Switch (/home/rjaw/cs-web/cs-web-proto/node_modules/react-router/cjs/react-router.js:866:29)
    at div
    at Provider (/home/rjaw/cs-web/cs-web-proto/node_modules/react-redux/lib/components/Provider.js:21:20)
    at App
    at Router (/home/rjaw/cs-web/cs-web-proto/node_modules/react-router/cjs/react-router.js:283:30)
    at BrowserRouter (/home/rjaw/cs-web/cs-web-proto/node_modules/react-router-dom/cjs/react-router-dom.js:75:35)

This is because the Error component that we create in this case is missing the `key' prop. Simple fix is to just add one which is anyway already available to us.

Stops warnings in the test that each component needs the key prop
Copy link
Collaborator

@abigailalexander abigailalexander left a comment

Choose a reason for hiding this comment

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

Confirmed in machine status this removes the warning above

@rjwills28 rjwills28 merged commit a2f58f5 into master Jan 10, 2025
2 checks passed
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.

3 participants