Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
Mirrored from https://github.com/Camo67/composio.git
Synced Nov 22, 14:30 UTC
fix(docs): sync FrameworkSelector with prop updates
Add useEffect to sync internal state when value prop changes, fixing controlled component behavior. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sushmithamallesh committed
Jan 22, 2026 at 11:47 UTC
085712cd66d65966b5033d483ab28ae75646073e
1 file changed
+6
-1
docs/components/quickstart/framework-selector.tsx
+6
-1
@@ -1,7 +1,7 @@
1
'use client';
2
3
import Image from 'next/image';
4
-import { useState } from 'react';
4
+import { useState, useEffect } from 'react';
5
6
export type Framework =
7
| 'openai-agents'
@@ -107,6 +107,11 @@ interface FrameworkSelectorProps {
107
export function FrameworkSelector({ value = 'openai-agents', onChange }: FrameworkSelectorProps) {
108
const [selected, setSelected] = useState<Framework>(value);
109
110
+ // Sync internal state with prop changes
111
+ useEffect(() => {
112
+ setSelected(value);
113
+ }, [value]);
114
+
115
const handleSelect = (framework: Framework) => {
116
setSelected(framework);
117
onChange?.(framework);