This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// try it : https://codesandbox.io/s/sample-next-ts-rhf-zod-9ieev | |
import React from "react"; | |
import { useForm } from "react-hook-form"; | |
import { zodResolver } from "@hookform/resolvers/zod"; | |
import { z } from "zod"; | |
import type { FieldError } from "react-hook-form"; | |
// JSON.stringify(error) will not work, because of circulare structure. So we need this helper. |