brilliant-orangeB
Refine3y ago
7 replies
brilliant-orange

To reset inputField after useForm successfully saves?

const {
    register,
    formState: { errors },
    handleSubmit,
    refineCore: {onFinish, id, setId},
  } = useForm<IPointDetail, HttpError, Nullable<IPointDetail>>({
    refineCoreProps: {
      resource: "point_detail",
      action: "create",
      redirect: "list",
    },
  });

<OutlinedInput
                  type="number"
                  id="point"
                  error={!!errors.point}
                  {...register("point", {
                    required: t(
                      "errors.required.field",
                      {
                        field: "point",
                      },
                    ),
                  })}
                  style={{height: "40px"}}
                />


I want to make the point an empty field after it's saved.
Was this page helpful?