mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
refactor: remove unused and log file reader result
This commit is contained in:
parent
453c6f289c
commit
53695f95e1
@ -21,9 +21,6 @@ function fileReaderPromise(file: File) {
|
||||
});
|
||||
}
|
||||
|
||||
// const serialize = (): undefined => undefined;
|
||||
// const deserialize = (): undefined => undefined;
|
||||
|
||||
export const FilesControl: FunctionComponent<FilesControlProps> = ({ onChange, name, accept }) => (
|
||||
<FileInput
|
||||
type="file"
|
||||
@ -31,14 +28,13 @@ export const FilesControl: FunctionComponent<FilesControlProps> = ({ onChange, n
|
||||
multiple
|
||||
onChange={(e: ChangeEvent<HTMLInputElement>) => {
|
||||
if (e.target.files) {
|
||||
Promise.all(Array.from(e.target.files).map(fileReaderPromise)).then(onChange);
|
||||
Promise.all(Array.from(e.target.files).map(fileReaderPromise)).then((result) => {
|
||||
console.log('READ FILE RESULT', result);
|
||||
onChange(result);
|
||||
});
|
||||
}
|
||||
}}
|
||||
accept={accept}
|
||||
size="flex"
|
||||
/>
|
||||
);
|
||||
|
||||
FilesControl.defaultProps = {
|
||||
onChange: (value) => value,
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user