Getting Started with React SPFx CRUD & Search WebPart
This blog explains how you can clone my GitHub repository, install dependencies, and run the SPFx React web part for:
✅ CRUD operations on SharePoint list items
✅ Searching list items
✅ Selecting list name from the property pane
👉 GitHub Repo: ReactSPFx
📌 Step 1 – Prerequisites
Before you start, make sure you have:
-
Office 365 / M365 tenant with SharePoint Online
-
Node.js (LTS) compatible with SPFx version in the project
-
npm (comes with Node.js)
-
Yeoman and gulp installed globally
Access to App Catalog if you want to deploy
📌 Step 2 – Clone Repository
Open your terminal and run:
install git to run below command
- git clone https://github.com/sunilshetty07/ReactSPFx.git
- cd ReactSPFx
📌 Step 3 – Install Dependencies
Run the following inside the folder:
- npm install
This installs React, SPFx controls, PnP libraries, Fluent UI, etc.
📌 Step 4 – Run in Local Workbench
Start the local dev server:
- gulp serve
-
Local:
https://localhost:4321/temp/workbench.html
-
Online:
https://<your-tenant>.sharepoint.com/sites/<yoursite>/_layouts/15/workbench.aspx
📌 Step 5 – Configure Property Pane
-
Add the webpart to the page.
-
Open the Property Pane.
-
Select a List Name from the dropdown.
-
Now you can perform CRUD operations and search items.
📌 Step 6 – Package & Deploy (Optional)
When ready to deploy:
- gulp bundle --ship
- gulp package-solution --ship
This will create a .sppkg
file inside:
sharepoint/solution
Upload this file to the App Catalog and deploy.
Go to any site page, edit the page, add the webpart, update the Property Pane settings as needed, and then republish the page to see it in action.
✅ Quick Commands Recap
git clone https://github.com/sunilshetty07/ReactSPFx.git
cd ReactSPFx
npm install
gulp serve
# For deployment
gulp bundle --ship
gulp package-solution --ship
🎯 Conclusion
That’s it! 🎉 You now have a working React SPFx WebPart with CRUD, search, and property pane list selection.
👉 Try cloning the repo here: ReactSPFx GitHub
Comments
Post a Comment