谁能指导我使用可用于使用 React 的 SharePoint 框架的 React Dropzone npm 包的工作代码?
谢谢你。
谁能指导我使用可用于使用 React 的 SharePoint 框架的 React Dropzone npm 包的工作代码?
谢谢你。
我有一个 1.8.2 的工作示例
import Dropzone from 'react-dropzone';
import * as React from 'react';
public render(): React.ReactElement<IAccountReaderProps> {
return <div>
<Dropzone onDrop={this.onDrop}>
{({ getRootProps, getInputProps, isDragActive, isDragAccept, isDragReject, acceptedFiles, rejectedFiles }) => {
return (
<div>
<div {...getRootProps()} className={styles.dragAndDropWrapper}>
<input {...getInputProps()} />
<div>
<h1>Drag and drop file here</h1>
</div>
{isDragReject && <div>Unsupported file type...</div>}
</div>
</div>
);
}}
</Dropzone>
</div>;
}
private onDrop = (acceptedFiles, rejectedFiles) => {
}