CRUD operation Demo using React hooks, context and PnP-JS-Core to add edit and delete a custom sharepoint list
-
Build file using npm run build
-
React files are bundled into one single js file called "react-pnp.js"
-
Upload react-pnp.js file to sharepoint Site Assets folder
-
Create a new page on Site Pages ( you can name it anything )
-
edit the page and add this html tag
<div id="root"></div>
-
Insert Script Editor to the page
- Insert > WebPart > Media and Content > Script Editor
-
on Script Editor, Edit Web Part > Edit Snippet
- add this script tag to refer to your site assets
<script type="text/javascript" src="your_sharepoint_url/SiteAssets/react-pnp.js"></script>
- add this script tag to refer to your site assets
-
next, create a custom list with columns below and use its ID on your code