mirror of
https://github.com/zhigang1992/react.git
synced 2026-03-27 22:54:38 +08:00
fix(checkbox): fix export type (#376)
This commit is contained in:
@@ -34,7 +34,7 @@ const defaultProps = {
|
||||
value: '',
|
||||
}
|
||||
|
||||
type NativeAttrs = Omit<React.LabelHTMLAttributes<any>, keyof Props>
|
||||
type NativeAttrs = Omit<React.InputHTMLAttributes<any>, keyof Props>
|
||||
export type CheckboxProps = Props & typeof defaultProps & NativeAttrs
|
||||
|
||||
const Checkbox: React.FC<CheckboxProps> = ({
|
||||
@@ -91,9 +91,15 @@ const Checkbox: React.FC<CheckboxProps> = ({
|
||||
}, [checked])
|
||||
|
||||
return (
|
||||
<label className={`${className}`} {...props}>
|
||||
<label className={`${className}`}>
|
||||
<CheckboxIcon disabled={isDisabled} checked={selfChecked} />
|
||||
<input type="checkbox" disabled={isDisabled} checked={selfChecked} onChange={changeHandle} />
|
||||
<input
|
||||
type="checkbox"
|
||||
disabled={isDisabled}
|
||||
checked={selfChecked}
|
||||
onChange={changeHandle}
|
||||
{...props}
|
||||
/>
|
||||
<span className="text">{children}</span>
|
||||
|
||||
<style jsx>{`
|
||||
|
||||
Reference in New Issue
Block a user