Skip to content

Commit

Permalink
Removes enum deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
iway1 committed Mar 12, 2023
1 parent 90cc24d commit 21b1706
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/logging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,8 @@ export function duplicateTypeError() {
);
}

export function printWarningsForSchema(type: RTFSupportedZodTypes) {
if (
!shownWarnings.enum &&
type._def.typeName === ZodFirstPartyTypeKind.ZodEnum
) {
err(
"support for z.enum() is deprecated and will be removed in future versions. Prefer z.string() / z.number() etc for dropdowns, selects, and radio buttons. \nSee https://github.com/iway1/react-ts-form/blob/main/field-examples.md for examples"
);
shownWarnings.enum = true;
}
export function printWarningsForSchema(_type: RTFSupportedZodTypes) {
// placeholder in case we need future schema warnings
}

export function printUseEnumWarning() {
Expand Down

0 comments on commit 21b1706

Please sign in to comment.