
Cormick Browne
Software Engineer
React
Redux
Relay
CODE EXAMPLE
class TodoList extends React.Component { constructor() { this.state = { todos = [ 'Create React example', 'Add content', 'Iterate on design' ] }; } addTodo(todo) { this.setState(({todos}) => ({ todos: todos.concat([todo]) })); } render() { return ( <h3>Todo List</h3> <ul> {this.state.todos.map(todo => <li>{todo}</li> } </ul> <input /> <button onClick={this.addTodo}/> ); } }
RESULT