Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
docs: fix portal timing bug for integration tabs header
The IntegrationTabsHeader useEffect ran with empty deps before the portal target div existed (frameworks register asynchronously). Use a MutationObserver to wait for the target to appear in the DOM. Also remove redundant text-left on the "Other providers" link. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sushmitha Mallesh committed
Mar 5, 2026 at 12:16 UTC
b05a34ec2e1ff4fdad4bd9597c781ea51a316852
2 files changed
+16
-2
docs/components/quickstart/integration-tabs.tsx
+15
-1
@@ -28,7 +28,21 @@ function IntegrationTabsHeader({ tabs }: { tabs: TabConfig[] }) {
28
const [portalTarget, setPortalTarget] = useState<HTMLElement | null>(null);
29
30
useEffect(() => {
31
- setPortalTarget(document.getElementById('integration-tabs-portal'));
31
+ const target = document.getElementById('integration-tabs-portal');
32
+ if (target) {
33
+ setPortalTarget(target);
34
+ return;
35
+ }
36
+ // Portal target may not exist yet (frameworks register asynchronously via useEffect)
37
+ const observer = new MutationObserver(() => {
38
+ const el = document.getElementById('integration-tabs-portal');
39
+ if (el) {
40
+ setPortalTarget(el);
41
+ observer.disconnect();
42
+ }
43
+ });
44
+ observer.observe(document.body, { childList: true, subtree: true });
45
+ return () => observer.disconnect();
46
}, []);
47
48
const header = (
docs/components/quickstart/quickstart-flow.tsx
+1
-1
@@ -176,7 +176,7 @@ export function QuickstartFlow({ children }: QuickstartFlowProps) {
176
))}
177
<Link
178
href="/docs/providers"
179
- className="flex items-center gap-3 rounded-lg border border-dashed border-fd-border px-3 py-2.5 text-left transition-all hover:bg-fd-accent/50 hover:border-fd-muted-foreground"
179
+ className="flex items-center gap-3 rounded-lg border border-dashed border-fd-border px-3 py-2.5 transition-all hover:bg-fd-accent/50 hover:border-fd-muted-foreground"
180
>
181
<span className="flex h-6 w-6 shrink-0 items-center justify-center text-fd-muted-foreground">→</span>
182
<span className="text-sm font-medium text-fd-muted-foreground">Other providers</span>