Fix nested component remount and auto-close on path change. Co-authored-by: Moheeb Zara <[email protected]>