File size: 470 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { FormFileUpload } from '@wordpress/components';

const FormFileUploadExample = () => (
	<FormFileUpload
		// @ts-expect-error The FormFileUpload components passes button props internally, but the types don't account for that.
		variant="primary"
		multiple
		onChange={ ( event ) =>
			window.alert( `${ event?.target?.files?.length ?? 0 } files uploaded!` )
		}
	>
		Click here to upload some files.
	</FormFileUpload>
);

export default FormFileUploadExample;