标签: react-web

反应长记事件

有没有办法在react-web应用程序中添加长按事件?

我有地址列表.长按任何地址,我想触发事件删除该地址,然后是确认框.

dom-events reactjs react-web create-react-app

19
推荐指数
6
解决办法
1万
查看次数

formik 警告,组件正在更改要控制的文本类型的不受控制的输入

我正在 React Web 中开发动态,当用户点击添加按钮注册表单被添加到屏幕时。在注册表中,我使用 formik 集成进行验证。表单动态添加成功,但是当我开始在输入框中输入任何输入时,我在控制台中遇到以下错误

index.js:1 Warning: A component is changing an uncontrolled input of type text to be controlled. Input elements should not switch from uncontrolled to controlled (or vice versa). Decide between using a controlled or uncontrolled input element for the lifetime of the component. 
Run Code Online (Sandbox Code Playgroud)

我不知道哪里错了。下面是我的动态表单渲染代码 -

账户.js

import React, { Component } from 'react';
import axios from 'axios';
import {Card, CardBody, CardHeader,Button,Col, Row, Form, Container} from 'reactstrap';
import { Formik, Field, ErrorMessage } from 'formik';
import …
Run Code Online (Sandbox Code Playgroud)

react-web formik

5
推荐指数
2
解决办法
6346
查看次数