Gazebo_simulation-Frontend/node_modules/react-dropzone/typings/tests/hook.tsx
2020-12-21 10:29:31 -05:00

16 lines
360 B
TypeScript

import React from "react";
import {useDropzone, DropzoneProps} from "../../";
export const Dropzone = ({children, ...opts}: DropzoneProps) => {
const {...state} = useDropzone(opts);
return children(state);
}
<Dropzone>
{({getRootProps, getInputProps}) => (
<div {...getRootProps()}>
<input {...getInputProps()} />
</div>
)}
</Dropzone>