mirror of
https://github.com/ascribe/onion.git
synced 2024-11-15 09:35:10 +01:00
33 lines
776 B
JavaScript
33 lines
776 B
JavaScript
|
import React from 'react';
|
||
|
|
||
|
import AlertMixin from '../../mixins/alert_mixin'
|
||
|
|
||
|
let InputHidden = React.createClass({
|
||
|
|
||
|
mixins : [AlertMixin],
|
||
|
|
||
|
getInitialState() {
|
||
|
return {value: this.props.value,
|
||
|
alerts: null // needed in AlertMixin
|
||
|
};
|
||
|
},
|
||
|
handleChange(event) {
|
||
|
this.setState({value: event.target.value});
|
||
|
},
|
||
|
render() {
|
||
|
let alerts = (this.props.submitted) ? null : this.state.alerts;
|
||
|
return (
|
||
|
<div className="form-group">
|
||
|
{alerts}
|
||
|
<input
|
||
|
value={this.props.value}
|
||
|
type="hidden"
|
||
|
onChange={this.handleChange}
|
||
|
/>
|
||
|
</div>
|
||
|
);
|
||
|
|
||
|
}
|
||
|
});
|
||
|
|
||
|
export default InputHidden;
|