Skip to content

Commit 6580831

Browse files
perf(web): toggle groups compile with the React Compiler
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 4573b89 commit 6580831

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎apps/web/reactCompiledFiles.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,5 @@ export const REACT_COMPILED_FILES = [
2828
"apps/web/src/components/ComposerPromptEditorTiptap.tsx",
2929
"apps/web/src/browser/ServerBrowserSurface.tsx",
3030
"apps/web/src/assets/assetUrls.ts",
31+
"apps/web/src/components/ui/toggle-group.tsx",
3132
] as const;

‎apps/web/src/components/ui/toggle-group.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ const ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariant
1616
function ToggleGroup({
1717
className,
1818
variant = "segmented",
19-
size = variant === "segmented" ? "segmented" : "default",
19+
size: sizeProp,
2020
orientation = "horizontal",
2121
children,
2222
...props
2323
}: ToggleGroupPrimitive.Props & VariantProps<typeof toggleVariants>) {
24-
const value = React.useMemo(() => ({ size, variant }), [size, variant]);
24+
const size =
25+
sizeProp === undefined ? (variant === "segmented" ? "segmented" : "default") : sizeProp;
26+
const value = { size, variant };
2527
return (
2628
<ToggleGroupPrimitive
2729
className={cn(

0 commit comments

Comments
 (0)