我有一个 and表单,当我按下提交按钮时,就可以在onFinish function中获取表单数据,在该按钮中,我希望使用uesEffect hook,并将表单数据作为有效负载分派到redux中,但我得到了以下错误
React Hook "useEffect" is called in function "onFinish" that is neither a React function component nor a custom React Hook function.
如果我在onFinsh 函数之外编写useEffect钩子,则无法获得表单数据/值。
我正在尝试使用react hook forms提交一份表单。提交后,我想清除所有的字段。我读过关于使用reset()的文章。但它不起作用
import React, { Fragment } from "react";
import { useForm } from "react-hook-form";
import { yupResolver } from "@hookform/resolvers/yup";
import * as Yup from "yup";
import "react-toastify/dist/
我将react-hook-form字段作为子级发送到另一个函数组件。按下提交按钮后,该字段将刷新,输入的值将被删除。有什么问题吗? CodeSandBox example is here 我的文件App.js import React from "react";
import "./styles.css";
import { useForm } from "react-hook-form";
import { Box, Button, Grid, TextField } from "@material-ui/core";
ex