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

Each child in a list should have a unique "key" prop #872

Closed
BTOdell opened this issue Dec 14, 2023 · 1 comment · Fixed by #887
Closed

Each child in a list should have a unique "key" prop #872

BTOdell opened this issue Dec 14, 2023 · 1 comment · Fixed by #887

Comments

@BTOdell
Copy link

BTOdell commented Dec 14, 2023

Description

This displays when bundling to a static site.

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

Check the top-level render call using <ul>. See https://reactjs.org/link/warning-keys for more information.
    at li
    at Operation (D:\Programming\...\docs\node_modules\@asyncapi\react-component\lib\cjs\containers\Operations\Operation.js:48:43)
    at li
    at ul
    at section
    at Operations (D:\Programming\...\docs\node_modules\@asyncapi\react-component\lib\cjs\containers\Operations\Operations.js:14:45)
    at div
    at div
    at div
    at section
    at AsyncApiLayout (D:\Programming\...\docs\node_modules\@asyncapi\react-component\lib\cjs\containers\AsyncApi\Layout.js:40:23)
    at AsyncApiComponent (D:\Programming\...\docs\node_modules\@asyncapi\react-component\lib\cjs\containers\AsyncApi\Standalone.js:99:28)
    at AsyncApiComponent (D:\Programming\...\docs\node_modules\@asyncapi\react-component\lib\cjs\containers\AsyncApi\AsyncApi.js:87:28)

Expected result

No output related to improper React usage.

Actual result

This warning is printed.

Steps to reproduce

Haven't produced a minimal example, but the stack trace should be enough to isolate the issue (even though the line numbers seem to be messed up).
My guess is that the issue is here: https://github.com/asyncapi/asyncapi-react/blob/master/library/src/containers/Operations/Operation.tsx#L268
It's the only <li> element without a key prop in that file.

Copy link

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

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 a pull request may close this issue.

1 participant