score:0

yes, it is ok to use onchange on dragger if you are already not using in its props. and in the given example there is already onchange property in props object that you are passing to dragger, so you should not use another onchange attribute instead you can write your logic inside onchange property of props object

const { dragger } = upload;

const props = {
    name: 'file',
    multiple: true,
    action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
    //here is onchange function written and you can use this to perform your action
    onchange(info) {
      const { status } = info.file;
      if (status !== 'uploading') {
        console.log(info.file, info.filelist);
      }
      if (status === 'done') {
        message.success(`${info.file.name} file uploaded successfully.`);
      } else if (status === 'error') {
        message.error(`${info.file.name} file upload failed.`);
      }
    },
  };

.
.
.
<dragger {...props}>
   <p> ... </p>
</dragger>


Related Query

More Query from same tag