Skip to content

Commit 0d08780

Browse files
author
Vlad Balin
committed
small cleanup
1 parent 14bbbad commit 0d08780

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37754,7 +37754,7 @@
3775437754
displayName: "AddTodo",
3775537755

3775637756
props: {
37757-
onEnter: Function
37757+
onEnter: Function.value(function () {})
3775837758
},
3775937759

3776037760
state: {
@@ -37782,9 +37782,9 @@
3778237782

3778337783
if (keyCode === 13) {
3778437784
var state = this.state;
37785-
var onEnter = this.props.onEnter;
37785+
var props = this.props;
3778637786

37787-
onEnter && state.desc && onEnter(state.desc);
37787+
state.desc && props.onEnter(state.desc);
3778837788
state.desc = "";
3778937789
}
3779037790
}

app.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/addtodo.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'nestedreact'
22

33
const AddTodo = React.createClass({
44
props : {
5-
onEnter : Function
5+
onEnter : Function.value( function(){} )
66
},
77

88
state : {
@@ -23,9 +23,9 @@ const AddTodo = React.createClass({
2323

2424
onKeyDown({ keyCode }){
2525
if( keyCode === 13 ){
26-
let { state, props : { onEnter } } = this;
26+
let { state, props } = this;
2727

28-
onEnter && state.desc && onEnter( state.desc );
28+
state.desc && props.onEnter( state.desc );
2929
state.desc = "";
3030
}
3131
}

0 commit comments

Comments
 (0)