📅  最后修改于: 2022-03-11 14:55:38.534000             🧑  作者: Mango
const onFileChange = (event: any) => {
{
!isDocReplace ?
(
setUploadPayload({ ...uploadPayload, file: event.target.files[0] })
) :
setReplacePayload({ ...replacePayload, file: event.target.files[0] }) // storing file detail for payload
}
setNewFileUploaded(true);
setFileName(event.target.files[0].name); // storing name of file in a state
};