I just started learning React. I created a simple form. Now I want to log in the console. But it gives an error.
Here is an image of the error:
Also attaching my code:
import React from 'react';
function RegistrationForm(props){
function handleSubmit(){
console.log('Inside handle Submit');
}
return(
<form onSubmit={handleSubmit}>
<div className="form-group">
<label htmlFor="task">Add task</label>
<input id="task" className="form-control"/>
</div>
<button className="btn btn-primary">Submit</button>
</form>
)
}
export default RegistrationForm;