Skip to content
Discussion options

You must be logged in to vote

index.js

import React, { useRef } from "react";
import ReactDOM from "react-dom";
import { useForm, Controller } from "react-hook-form";
import { MyCombobox } from "./MyCombobox";

function App() {
  const statusRef = useRef(null); // Create a ref

  const { control, handleSubmit } = useForm({
    defaultValues: {},
    mode: "all"
  });

  return (
    <form
      onSubmit={handleSubmit((data) => {
        console.log(data);
      })}
      className="form"
    >
      <Controller
        name="status"
        control={control}
        rules={{
          required: {
            value: true,
            message: "hiello error"
          }
        }}
        render={({ field }) => {

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@gangadharjannu
Comment options

Answer selected by gangadharjannu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants