Skip to content

Commit

Permalink
Add more helpful error for RadioGroup choices type
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnStarich committed Mar 1, 2020
1 parent 0202f7b commit 2728231
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/RadioGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export default function RadioGroup(props) {
smColumns,
...remainingProps
} = props;
if (!choices) {
throw new Error("Choices prop must be provided")
if (!choices || ! Array.isArray(choices)) {
throw new Error("Choices array must be provided")
}
if (smColumns && smColumns.length !== 2) {
throw new Error("smColumns prop must be an array of 2 column widths")
Expand Down

0 comments on commit 2728231

Please sign in to comment.