Skip to content

Commit 5ffd5c5

Browse files
committed
fix: fix typo when checking validity
1 parent 0d43ca9 commit 5ffd5c5

File tree

1 file changed

+2
-1
lines changed
  • packages/create-react-native-library/src

1 file changed

+2
-1
lines changed

packages/create-react-native-library/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,8 @@ async function create(argv: yargs.Arguments<any>) {
403403
let valid = question.validate ? question.validate(String(value)) : true;
404404

405405
// We also need to guard against invalid choices
406-
if (valid && 'choices' in question) {
406+
// If we don't already have a validation message to provide a better error
407+
if (typeof valid !== 'string' && 'choices' in question) {
407408
const choices =
408409
typeof question.choices === 'function'
409410
? question.choices(undefined, argv, question)

0 commit comments

Comments
 (0)