fix: default prop values
This commit is contained in:
parent
fd802239f9
commit
bd9615c5ea
1 changed files with 26 additions and 17 deletions
|
|
@ -2,13 +2,21 @@ import React, { memo } from 'react'
|
||||||
|
|
||||||
import { Checkbox } from '../base'
|
import { Checkbox } from '../base'
|
||||||
|
|
||||||
const CheckboxInput = memo(({ label, textAlign, fullWidth, ...props }) => {
|
const CheckboxInput = memo(
|
||||||
|
({
|
||||||
|
label,
|
||||||
|
textAlign,
|
||||||
|
fullWidth,
|
||||||
|
enabled = true,
|
||||||
|
disabledMessage = '',
|
||||||
|
...props
|
||||||
|
}) => {
|
||||||
const { name, onChange, value } = props.field
|
const { name, onChange, value } = props.field
|
||||||
|
|
||||||
const settings = {
|
const settings = {
|
||||||
enabled: props.enabled ?? true,
|
enabled: enabled,
|
||||||
label: label,
|
label: label,
|
||||||
disabledMessage: props.disabledMessage ?? ''
|
disabledMessage: disabledMessage
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
@ -20,6 +28,7 @@ const CheckboxInput = memo(({ label, textAlign, fullWidth, ...props }) => {
|
||||||
{...props}
|
{...props}
|
||||||
/>
|
/>
|
||||||
)
|
)
|
||||||
})
|
}
|
||||||
|
)
|
||||||
|
|
||||||
export default CheckboxInput
|
export default CheckboxInput
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue