| 3 | import Tags from './Tags.jsx'; |
| 4 | |
| 5 | class App extends React.Component { |
| 6 | constructor(props) { |
| 7 | super(props); |
| 8 | |
| 9 | this._addNewTag = this._addNewTag.bind(this); |
| 10 | this.state = { |
| 11 | tags: ['JavaScript', 'CSS' ], |
| 12 | newTag: null |
| 13 | }; |
| 14 | } |
| 15 | _addNewTag() { |
| 16 | this.setState({ newTag: this.refs.field.value }); |
| 17 | } |
| 18 | render() { |
| 19 | return ( |
| 20 | <div> |
| 21 | <p>Add new tag:</p> |
| 22 | <div> |
| 23 | <input type='text' ref='field' /> |
| 24 | <button onClick={ this._addNewTag }>Add</button> |
| 25 | </div> |
| 26 | <Tags tags={ this.state.tags } newTag={ this.state.newTag } /> |
| 27 | </div> |
| 28 | ); |
| 29 | } |
| 30 | } |
| 31 | App.propTypes = { |
| 32 | service: React.PropTypes.object |
| 33 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected