The process of building custom applications and tools that interact with Microsoft SharePoint, including SharePoint Online in Microsoft 365.
I'm just a fellow community user, so please treat this as general guidance. I haven't tested it with your web part.
What you're seeing is expected behavior: an SPFx web part usually loads the list data once, when the page loads, so it isn't aware of later changes to the list. To keep the data up to date without a page refresh, the web part needs to reload the data itself. Here are some options:
- Polling: reload the list data on a timer, for example every 30–60 seconds, using setInterval in your web part or React component. Clear the timer when the component is disposed, and keep the interval reasonable to avoid unnecessary requests and throttling. You can also reload the data when the browser tab becomes active again (the visibilitychange event), so users see fresh data when they come back to the page.
- List subscription: SPFx has a List subscription capability. To subscribe to changes, you create an instance of the ListSubscriptionFactory class and call the createSubscription() method with the ID of the list. Your web part can then reload its data only when a change notification arrives. Note that the official article describes this for document libraries. There is a PnP community sample that, according to its description, uses the List subscription capability to get notified of changes to a custom list and refresh the displayed data, so it may also work for your list, but please test it in your environment.
- Check caching: if you use PnPjs caching, or store data in localStorage or sessionStorage, make sure the cached data expires or is skipped when you reload, otherwise the web part may keep showing old values.
To help others give more specific advice, could you share:
- Which SPFx version you're using?
- How the web part gets the data (PnPjs, SPHttpClient or Microsoft Graph)?
- Whether you use any caching?
- Whether the data comes from a regular list or a document library?
Please let me know more details