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

Get key props error with custom component #173

Open
anujshah108 opened this issue Sep 27, 2021 · 2 comments
Open

Get key props error with custom component #173

anujshah108 opened this issue Sep 27, 2021 · 2 comments

Comments

@anujshah108
Copy link

anujshah108 commented Sep 27, 2021

const FeedbackFileUpload = () => {
  return (
    <FileUploaderDropzone>
      <FileUploaderIcon>
        <Publish />
      </FileUploaderIcon>
      <FileUploaderTitle variant="subtitle2">
        Drag and Drop Files
      </FileUploaderTitle>
      <FileUploaderBrowse variant="subtitle1">Browse Files</FileUploaderBrowse>
    </FileUploaderDropzone>
  );
};

I have this custom component that I insert into inputContent

   <Dropzone
      // disabled={Boolean(response || loading)}
        key={dropzoneKey}
        onChangeStatus={handleChangeStatus}
        submitButtonDisabled={true}
        inputContent={<FeedbackFileUpload />}
      />

I get the error:

index.js:1 Warning: Each child in a list should have a unique "key" prop. See https://reactjs.org/link/warning-keys for more information.
at label
at O (http://localhost:3000/static/js/vendors~main.chunk.js:246033:15)
at div

Any help?

@audree1
Copy link

audree1 commented Oct 16, 2021

I starting receiving that warning as well.

@diegolego
Copy link

Same problem. Just add a unique key to each "inputContent" element. That will make the warning disappear.

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

No branches or pull requests

3 participants