From c5f00991424e59eeea1ef2519899b498922c3612 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 05:14:22 +0000 Subject: [PATCH] fix(ui): forward refs correctly and follow component patterns in Button - Ensure React.forwardRef is correctly implemented. - Add Button.displayName for better debugging. - Add propTypes for the style prop. - Correctly merge the style prop with default boxShadow: none. - Remove unused React.useState import. - Align export pattern with other UI components. Co-authored-by: ragsav <45696355+ragsav@users.noreply.github.com> --- .../src/presentation/components/ui/button.jsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/apps/frontend/src/presentation/components/ui/button.jsx b/apps/frontend/src/presentation/components/ui/button.jsx index 3d8094b..2aec148 100644 --- a/apps/frontend/src/presentation/components/ui/button.jsx +++ b/apps/frontend/src/presentation/components/ui/button.jsx @@ -1,9 +1,23 @@ -import React, { useState } from "react"; +import React from "react"; +import PropTypes from "prop-types"; import { Button as AntButton } from "antd"; // Bug fix: ButtonWrapper now forwards refs correctly -export const Button = React.forwardRef((props, ref) => { - return ; +const Button = React.forwardRef(({ style, ...props }, ref) => { + return ( + + ); }); +Button.displayName = "Button"; +Button.propTypes = { + style: PropTypes.object, +}; + +export { Button };