所以我有一个用React-bootstrap组件制作的弹出表单。我在控制台上收到此错误:
警告:findDOMNode在StrictMode中已弃用。 findDOMNode传递了StrictMode内部的Transition实例。而是直接将引用添加到要引用的元素。在此处了解有关安全使用裁判的更多信息: 在div中(由Modal创建) 过渡中(由Fade创建) 在Fade中(由BackdropTransition创建) 在BackdropTransition中(由Modal创建) 在Modal中(由Modal创建) 在Modal中(在UpdateProfileForm.jsx:15) 在UpdateProfileForm中(位于Profile.js:91) 在div中(由Row创建) 行中(在Profile.js:86处) 在div中(由Card创建) 在卡片中(在Profile.js:31) 在div中(由Container创建) 在容器中(在Profile.js:30) 在配置文件中(由Context.Consumer创建) 在路线中(位于App.js:31) 在Switch中(在App.js:24) 在路由器中(由BrowserRouter创建) 在BrowserRouter中(在App.js:21) 在App中(位于src / index.js:9) 在StrictMode中(在src / index.js:8)
但我真的不知道如何解决。帮助
这是我的弹出表单组件。
import React from "react";
import { Modal, Button, InputGroup, Form, FormControl } from "react-bootstrap";
function CreateTeamForm(props) {
return (
<Modal
{...props}
size="lg"
aria-labelledby="contained-modal-title-vcenter"
centered
>
<Modal.Header closeButton>
<Modal.Title
id="contained-modal-title-vcenter"
style={{ fontSize: "30px" }}
>
CREATE TEAM
</Modal.Title>
</Modal.Header>
<Modal.Body>
<h4 style={{ fontSize: "20px" }}>Team Information</h4>
<InputGroup style={{ marginBottom: "1rem" }}>
<InputGroup.Prepend>
<InputGroup.Text>
<i className="fas fa-users fa"></i>
</InputGroup.Text>
</InputGroup.Prepend>
<FormControl id="Team Name" placeholder="Team Name" />
</InputGroup>
<InputGroup style={{ marginBottom: "1rem" }}>
<InputGroup.Prepend>
<InputGroup.Text>
<i className="fas fa-user-plus"></i>
</InputGroup.Text>
</InputGroup.Prepend>
<FormControl id="Members Emails" placeholder="Members Emails" />
</InputGroup>
<Form.Group controlId="Description">
<Form.Label>Description</Form.Label>
<Form.Control as="textarea" rows="3" />
</Form.Group>
</Modal.Body>
<Modal.Footer>
<Button onClick={props.onHide} variant="light">
Close
</Button>
<Button className="btn--primary" variant="primary">
CREATE
</Button>
</Modal.Footer>
</Modal>
);
}
export default CreateTeamForm;