Skip to content

Commit

Permalink
Merge pull request #246 from rafaelsteil/fix-warning-logic
Browse files Browse the repository at this point in the history
Improves valueKey not found warning logic
  • Loading branch information
dohomi authored Mar 28, 2024
2 parents ccd12d4 + 86236ed commit 722a77b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/rhf-mui/src/CheckboxButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const CheckboxButtonGroup = forwardRef(function CheckboxButtonGroup<
<FormGroup row={row}>
{options.map((option: any) => {
const optionKey = option[valueKey]
if (!optionKey) {
if (optionKey === undefined) {
console.error(
`CheckboxButtonGroup: valueKey ${valueKey} does not exist on option`,
option
Expand Down
4 changes: 2 additions & 2 deletions packages/rhf-mui/src/RadioButtonGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,9 @@ const RadioButtonGroup = forwardRef(function RadioButtonGroup<
)}
{options.map((option: any) => {
const optionKey = option[valueKey]
if (!optionKey) {
if (optionKey === undefined) {
console.error(
`CheckboxButtonGroup: valueKey ${valueKey} does not exist on option`,
`RadioButtonGroup: valueKey ${valueKey} does not exist on option`,
option
)
}
Expand Down

0 comments on commit 722a77b

Please sign in to comment.