我很难弄清楚如何处理不一定与react-hook-form中的单个输入字段相关的错误。换句话说,我如何处理handleSubmit错误?
例如,具有以下形式:
import to from 'await-to-js'
import axios, { AxiosResponse } from 'axios'
import React from "react"
import { useForm } from "react-hook-form"
type LoginFormData = {
username: string,
我有一个 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钩子,则无法获得表单数据/值。
我们在页面上创建命令链接。有时在网站的不同页面上使用相同的命令链接。第一次创建时,因为页面A没有窗体。
场景1
A页(页上没有表格)
一些文本
需要一个链接。因此,创建由表单包围的命令链接。
场景2
页B(从B页的A页重用commandLink )
<h:form>
Some text
Need a link. So, create command link surrounded by a form.
Reuse commandlink component from PageA
</h:form>
抛出一个错误,内部表单异常.
由于ur
我正在尝试使用react-bootstrap创建一个Modal react-hook-form with fullscreen modal without form WORK 但是,当我添加表单时,Modal在全屏中不能正常工作。 react-hook-form with fullscreen modal with form NO WORK 我认为问题是在哪里找到表单,以便它在html中正确打印。 谢谢!
我们有使用webforms模块构建的多页表单。在任何编号大于0的页面上,我们希望隐藏节点内容。此内容可以很长,并且不需要在表单的每一页上显示。
因此,我添加了一个自定义模块,并添加到其中...
/**
* Implementation of hook_form_alter().
*/
function bmc_customisations_form_alter(&$form, $form_state, $form_id) {
//dpm('form state page_num is '.$form_state['values']['
我正在制作一种需要将与集成起来的表单,为此,我在这个讨论中使用了Github:。但是,在销毁useFormContext时,如下所示:
const { control } = useFormContext();
我得到以下错误:
TypeError: Cannot destructure property 'control' of
'(0 , react_hook_form__WEBPACK_IMPORTED_MODULE_2__.useFormContext)(...)' as it is null.
我做了一些研究,发现了这个问题:,在这里,开发人员遇到了
我正在开发一个使用电容、离子、React的应用程序,最近我在第一次使用React Hook Form和YupResolver时遇到了以下错误: 当我试图运行这个项目时,我得到了这个错误: Failed to compile
./node_modules/@hookform/resolvers/dist/resolvers.module.js
Attempted import error: 'set' is not exported from 'react-hook-form' (imported as 'o'). 我想创建并验证一个用于更改密码
我试图用yup在react钩子表单上编写错误处理,但是当我想像文档说明()那样传递解析器时,我得到了这个错误:
SyntaxError:无法在模块module.exports =module.exports之外使用导入语句(“@钩子/解析器/yup”);
我的验证模式:
const schema = Yup.object().shape({
person: Yup.string()
.min(3, "To pole jest za krótkie")
.max(30, "To pole jest za długie")
.requ