I
I
Im p3l2021-10-17 12:28:25
React
Im p3l, 2021-10-17 12:28:25

How to display an error in Upload in Ant Design?

Good afternoon, tell me please.
When a file is deleted in the upload field, the status of the file changes to removed. But when submitting the form, the file is still sent.
How can I make it so that if the photo is deleted, then an error is displayed under the field with upload when submitting.


https://codepen.io/imp3l/pen/BadjEPp?editors=0010

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
WbICHA, 2021-10-17
@LoranDeMarcus

First, not console.log(file);, but . Secondly, in Form.Item. If you need to load data from the back, for example, then you will have to create a wrapper for the upload, because normalize works only in one direction.console.log(file.fileList[0]);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question