It looks like you have an extra bracket in there, also, the imported function will just be onSignUp
not this.onSignUp
.
import onSignUp from '../../functions/onsignup'
class ModalExample extends React.Component {
constructor(props) {
super(props);
this.onSignUp = onSignUp.bind(this);
}
render(){
return(...)
}
}
You should bind the function in the ctor
or alternatively assign it in the class to onSignup
like this:
import onSignUp from '../../functions/onsignup'
class ModalExample extends React.Component {
constructor(props) {
super(props);
}
onSignUp = onSignUp.bind(this);
render(){
return(...)
}
}
(I think)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…