🏷️(react) support ReactNode as input label
There are use cases that required to put links inside Checkboxes or Radio inputs.
This commit is contained in:
@@ -5,13 +5,14 @@ import React, {
|
||||
useEffect,
|
||||
useRef,
|
||||
useState,
|
||||
ReactNode,
|
||||
} from "react";
|
||||
import classNames from "classnames";
|
||||
import { Field, FieldProps } from ":/components/Forms/Field";
|
||||
|
||||
export type CheckboxOnlyProps = {
|
||||
indeterminate?: boolean;
|
||||
label?: string;
|
||||
label?: ReactNode;
|
||||
};
|
||||
|
||||
export type CheckboxProps = InputHTMLAttributes<HTMLInputElement> &
|
||||
|
||||
@@ -2,12 +2,13 @@ import React, {
|
||||
InputHTMLAttributes,
|
||||
PropsWithChildren,
|
||||
forwardRef,
|
||||
ReactNode,
|
||||
} from "react";
|
||||
import classNames from "classnames";
|
||||
import { Field, FieldProps } from ":/components/Forms/Field";
|
||||
|
||||
export type RadioOnlyProps = {
|
||||
label?: string;
|
||||
label?: ReactNode;
|
||||
};
|
||||
|
||||
export type RadioProps = InputHTMLAttributes<HTMLInputElement> &
|
||||
|
||||
Reference in New Issue
Block a user