ingred-ui icon indicating copy to clipboard operation
ingred-ui copied to clipboard

Refactor: ToggleButton

Open youchann opened this issue 4 years ago • 0 comments

ネイティブの<input />にprops群を寄せたい

react-hook-formなどのフォームライブラリと併用する際にあつかいづらいため。

- export type ToggleButtonProps = {
+ export type ToggleButtonProps = React.ComponentPropsWithRef<"input"> & {
-   active?: boolean; ← `checked`propsで扱う
  disabled?: boolean;
  onChange?: () => void;
  width?: string;
  activeText?: string;
  inActiveText?: string;
  inputRef?: React.Ref<HTMLInputElement>;
};

youchann avatar Dec 17 '20 03:12 youchann