Using Reactstrap for easy styling, and I'm using their <Input>
component, and I have the form built, but it's not allowing text input. The console is throwing this error when typing into the field:
I have the component setup and the rest of the form is working properly:
constructor(props) {
super(props);
this.state = {
firstName: "",
preferredName: "",
middleName: "",
lastName: "",
address1: "",
address2: "",
city: "",
state: "",
zip: "",
maxContacts: 5,
currentContacts: 0,
releaseDate: Date.now(),
gender: "M",
institutionId: "",
country: "US",
areaCode: 1,
language: "EN",
contacts: []
};
this.onChange = this.onChange.bind(this);
}
onChange = e => {
this.setState({ [e.target.name]: e.target.value });
};
render() {
let prependStyle = {
fontSize: "2pt",
fontFamily: "monospace"
};
inside the render, I set some basic style for later use in the component. Here is the portion of the JSX that is acting funny in the component:
<InputGroup>
<InputGroupAddon addonType="prepend" style={prependStyle}>
Institution ID
</InputGroupAddon>
<Input
type="text"
value={this.state.institutionId}
name="instituitonId"
onChange={this.onChange}
/>
</InputGroup>
Why is this behaving this way? (no problem editing to get more info.) This is the only field in the form that doesn't update the input on the rendered page, and while there is a date field, it's properly enclosed away from this element.