SharePoint Framework Extension to override sub site creation link
Sub: SPFX Extension - Subsite link override - Modern Experience
In classic experience, we are redirecting the users to a provider hosted site request form instead of out of the box site request page(/_layouts/15/newsbweb.aspx) using custom action. We are trying to create a SPFX Application Customizer to replace this functionality by getting the Subsite button element by name and attaching a click event which will redirect the users to the provider hosted site request form. But the logic is not 100% working as there is delay in rendering the dropdown values on new button click.
What is the right way to execute the code within the onInit method after the complete page load so that we can access the commandbar with class name CommandBarItem-link?