ImagePicker
3p-core / ImagePicker
Variable: ImagePicker
const
ImagePicker:React.FunctionComponent
<IImagePicker
>
ImagePicker
is a React component that enables selecting, previewing,
and uploading images to a SharePoint list item using the UploadImage
API.
Intended for use with image fields bound to the SharePoint list schema.
Example
<ImagePicker
sp={sp}
imageFieldValue={item.Image}
onFileSelected={async (file) => {
const newValue = await pushFile(sp, context, 'Documents', item.Id, file, 'Image');
await sp.web.lists.getByTitle('Documents').items.getById(item.Id).update({
Image: newValue
});
}}
/>