This repository has been archived on 2025-01-25. You can view files and clone it, but cannot push or open issues or pull requests.
tasky/src/components/input.js
2022-01-28 23:17:58 +01:00

21 lines
455 B
JavaScript

import React from 'react';
class Input extends React.Component {
read(e){
this.props.update(this.props.id, e.target.value)
}
render(){
switch (this.props.type) {
case 'submit':
return <input type="submit" value={this.props.lable} onClick={this.props.submit} />
default:
return <input type={this.props.type} placeholder={this.props.lable} onChange={this.read.bind(this)} />
}
}
}
export default Input;