Skip to content

Commit

Permalink
Merge pull request #7 from vaneenige/master
Browse files Browse the repository at this point in the history
Support for Preact 8! 🎉
  • Loading branch information
developit authored Apr 16, 2017
2 parents 52bf2c0 + 8411739 commit f4886c0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"webpack-dev-server": "^1.14.1"
},
"dependencies": {
"preact": "^4.8.0",
"preact-redux": "^1.0.1",
"redux": "^3.5.2"
"preact": "^8.1.0",
"preact-redux": "^1.2.0",
"redux": "^3.6.0"
}
}
8 changes: 6 additions & 2 deletions src/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import TodoItem from './todo-item';
@connect(reduce, bindActions(actions))
export default class App extends Component {
addTodos = () => {
let { text } = this.state;
const { text } = this.state;
this.setState({ text: '' });
this.props.addTodo(text);
return false;
Expand All @@ -18,11 +18,15 @@ export default class App extends Component {
this.props.removeTodo(todo);
};

updateText = (e) => {
this.setState({ text: e.target.value });
};

render({ todos }, { text }) {
return (
<div id="app">
<form onSubmit={this.addTodos} action="javascript:">
<input value={text} onInput={this.linkState('text')} placeholder="New ToDo..." />
<input value={text} onInput={this.updateText} placeholder="New ToDo..." />
</form>
<ul>
{ todos.map(todo => (
Expand Down

0 comments on commit f4886c0

Please sign in to comment.