diff --git a/src/frontend/src/components/ui/button.tsx b/src/frontend/src/components/ui/button.tsx index 6107b78a3..ca3001511 100644 --- a/src/frontend/src/components/ui/button.tsx +++ b/src/frontend/src/components/ui/button.tsx @@ -60,14 +60,6 @@ const Button = React.forwardRef( if (typeof children === "string") { newChildren = toTitleCase(children); } - const [width, setWidth] = React.useState(null); - const hiddenRef = React.useRef(null); - - React.useEffect(() => { - if (hiddenRef.current) { - setWidth(hiddenRef.current.offsetWidth); - } - }, [children, hiddenRef]); return ( <> ( ref={ref} {...props} > - <> - {loading ? ( -
- -
- ) : ( - children - )} - + {loading ? ( + + ) : ( + newChildren + )}
-
- {children} -
); },