I am creating SPFX web part with React.
In which I am trying to get the current page ID on which webpart is added. I was trying to check if I can get it directly from the page context.
I am getting page context using
this.context.pageContext but I noticed some of the properties are undefined.
this.context.pageContext.page these are undefined.
Could any one please tell me the reason behind this. OR please guide me on how to get the ID of the page on which web part is added.
Thanks a lot.