简体   繁体   English

事件侦听器无法处理我的联系表单

[英]The event Listener is not working on my contact form

I am trying to create a contact me form with React and I am getting the error of eventListener Null The database backend is hosted with firebase.我正在尝试使用 React 创建一个与我联系的表单,但出现eventListener Null错误数据库后端由eventListener Null托管。 My index.js code is below:我的index.js代码如下:

// Listen for form submit
document.getElementById('submitForm').addEventListener('contactMeForm', submitForm);

And the corresponding contactMeForm code is below:对应的contactMeForm代码如下:

<Button variant="primary" type="contactMeForm" id="submitForm" addEventListener="contactMeform">
Submit</Button>

What event are you trying to trigger ?你想触发什么事件? when you click on the button?当你点击按钮时? you don't have to call addEventListener in react.你不必在反应中调用 addEventListener 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM