HI,
I get the below error.
I’m trying to call a ‘start()’ function on Submit button.
I just can’t figure out why.
I tried using the arrow function for the start function Eg: start=()=>{}
But this did not work either. Any help is so much appreciated.
TypeError: this.props.emit is not a function
JoinAdmin.start
e:/BootCampUNC/Class/Assignments/FinalProject/newCreateReact/testapp/client/src/Components/JoinAdmin.js:10
7 | start(){
8 | var adminName = ReactDOM.findDOMNode(this.refs.name).value;
9 | var pollName = ReactDOM.findDOMNode(this.refs.PollName).value;
> 10 | this.props.emit('start');
| ^ 11 | // send this back to the server
12 |
13 | console.log ("name: "+ adminName +" pollName:" + pollName)
View compiled
onSubmit
e:/BootCampUNC/Class/Assignments/FinalProject/newCreateReact/testapp/client/src/Components/JoinAdmin.js:19
16 | render() {
17 | return (
18 | <div>
> 19 | <form action="javascript:void(0)" onSubmit={()=>this.start()}>
| ^ 20 | <label> Full Name </label>
21 | <input ref="name"
22 | className="form-control"