react-spfx | SharePoint Framework 2016 with React Js | Frontend Framework library
kandi X-RAY | react-spfx Summary
kandi X-RAY | react-spfx Summary
SharePoint Framework 2016 with React Js (Typescript/Axios/Antd/React-table).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of react-spfx
react-spfx Key Features
react-spfx Examples and Code Snippets
Community Discussions
Trending Discussions on react-spfx
QUESTION
I am creating an SP webpart using SPFX. The webpart needs to be able to upload multiple files either using one button or several buttons (one for each file).
I am trying to use this: https://pnp.github.io/pnpjs/sp/attachments/#add-multiple
But it doesn't show how to use it with React states. You see, I want to be able to save the file upload into state, so it can then be submitted using a button. That's when it is attached to the list item in SP. I then want the webpart to be able to display the attached item when the user clicks back on this item. This is why I need to use state.
I have read this: React SPFx - Adding files to SharePoint list field using PnPjs
and this: Handling file upload in Sharepoint List with React form
But they are not clear.
Can someone provide an example of how to use the pnpjs attachments with a React component class using state?
...ANSWER
Answered 2020-Aug-11 at 09:57My test code for your reference:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install react-spfx
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page