1
跟踪此问题的问题无法解决我的问题。Uncaught TypeError:超级表达式必须为null或函数,而不是未定义(...)
我反应过来的版本是 “^ 15.3.1”。
我已经加入下面
import React from 'react';
import { ButtonInput } from 'react-bootstrap';
import {Form,ValidatedInput} from 'react-bootstrap-validation';
class myComponent extends React.Component {
constructor(props) {
super(props);
this.handleValidSubmit = this.handleValidSubmit.bind(this);
this.handleInvalidSubmit = this.handleInvalidSubmit.bind(this);
}
handleValidSubmit(values){
}
handleInvalidSubmit(errors,values){
}
render() {
return (
<Form onValidSubmit={this.handleValidSubmit}
onInvalidSubmit={this.handleInvalidSubmit}>
<ValidatedInput
type='text'
label='Email'
name='email'
validate='required,isEmail'
errorHelp={{
required: 'Please enter your email',
isEmail: 'Email is invalid'
}}
/>
<ValidatedInput
type='password'
name='password'
label='Password'
validate='required,isLength:6:60'
errorHelp={{
required: 'Please specify a password',
isLength: 'Password must be at least 6 characters'
}}
/>
<ValidatedInput
type='password'
name='password-confirm'
label='Confirm Password'
validate={(val, context) => val === context.password}
errorHelp='Passwords do not match'
/>
<ValidatedInput
type='checkbox'
name='agree'
label='I agree to the terms and conditions'
validate='isChecked'
/>
<ButtonInput
type='submit'
bsSize='large'
bsStyle='primary'
value='Register'
/>
</Form>
);
}
}
module.exports = myComponent;
没有“Form”组件导入 – degr
import'Form,ValidatedInput} from'react-bootstrap-validation'; – Akshay
对不起,我现在看到。尝试在类声明之前执行诸如console.log(ButtonInput)之类的操作。看起来你的导入路径不正确。 – degr