Forum Discussion
Samaresh Das
Apr 04, 2017Copper Contributor
How to refresh SPFX webpart
I am developing webpart with new SharePoint Framework. I notice when user changed any value in property it refresh/reload the webpart. I want to refresh/reload the web part when user click on a butto...
Samaresh Das
Apr 04, 2017Copper Contributor
I am able to fire the click event and execute my custom code. Here need to fire a sharepoint framework method to refresh the webpart, so i need the sample code of SPFX webpart refresh method.
Luis Mañez
Apr 04, 2017MVP
I don't think there's a specific method to refresh the webpart itself. Are you using ReactJS in the webpart? in that case, if you follow ReactJS component lifecycle, the component re-renders when the state is updated. If you are using just JavaScript, and you say you're able to catch the event, then you need to refresh the DOM setting the new values.
- Samaresh DasApr 05, 2017Copper ContributorHi Luis,
I am not using any javascript framwork. I am able to manage the change DOM. But it would nice if framwork expose any interface to refresh the webpart programatically.