I'm trying to pass a function to a component, but I'm having the following problem:
"Reactjs pass function props to component Invalid value for prop addrow
on tag. Either remove it from the element, or pass a string or number value to keep it in the DOM."
Code:
constructor(props) {
super(props);
this.props = props;
this.addRows = this.addRows.bind(this);
}
addRows() {
console.log("AddRows")
}
<CreateQrModal
show={modalAdd}
onHide={this.modalAddClose}
addrow={this.addRows}
/>
Component:
handleSubmit() {
this.props.addrow()
}