Arrow functions and so
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
import { useMemo } from 'react';
|
||||
|
||||
/** Return a preview URL for a file. */
|
||||
function usePreview(file: File | null | undefined): string | undefined {
|
||||
return useMemo(() => {
|
||||
if (file) {
|
||||
return URL.createObjectURL(file);
|
||||
}
|
||||
}, [file]);
|
||||
}
|
||||
const usePreview = (file: File | null | undefined): string | undefined => useMemo(() => {
|
||||
if (file) {
|
||||
return URL.createObjectURL(file);
|
||||
}
|
||||
}, [file]);
|
||||
|
||||
export { usePreview };
|
||||
|
||||
Reference in New Issue
Block a user