Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.
When navigating from one page to another (using an link), this.context.pageContext should reflect the newly loaded page.
When navigating from one page to another, this.context.pageContext remains unchanges. This causes API calls to fail or produce faulty results.
This seems to be caused by the page not entirely refreshing when navigating between (modern) pages. Only the "main" content is updated (~ MDS).
@NickSevens , we are working on this.
@manishgarg1 any way to work around the issue in the mean time?
@NickSevens, finding out.
Any progress on this one? We have the same issue. We have a spfx web part that updates a field on the page item. If I've come from another page and edit the current page, the old page is being updated. Looks like this.context is not updated because it's not a full page reload.
Currently attempting a workaround by getting the page id with /GetFileByServerRelativeUrl and then updating the appropriate item.
@tarjeieo using the same workaround indeed...
Hi @tarjeieo, when you say this.context is not updated, can you please be a bit more explicit about what parts of the context are not updated on page-transition? Is this.context.pageContext not updated? If not, what exact fields in this.context.pageContext are not updated?
Hi @manishgarg1, I created a new issue for my problem with some more details, see #1201.
Closing this issue since 1201 is opened.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues
Most helpful comment
@tarjeieo using the same workaround indeed...