MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / App

Class App

code/third-party/src/app.jsx:5–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3import Tags from './Tags.jsx';
4
5class 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}
31App.propTypes = {
32 service: React.PropTypes.object
33};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected