I tried using context.pageContext.legacyPageContext.guestsEnabled
, but it returns false when external sharing on the site is set to "Existing guests only" and works fine for "New and Existing Guests".
Is there any other way to know if guest access is enabled on the site in SPFx?