Created
September 10, 2015 20:59
-
-
Save lahmatiy/66e8c94f68438e59e308 to your computer and use it in GitHub Desktop.
Find the difference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// react 0.14-rc1 | |
var Zoo = React.createClass({ | |
render: function() { | |
return <div>Giraffe name: <input ref="giraffe" /></div>; | |
}, | |
showName: function() { | |
// Previously: var input = this.refs.giraffe.getDOMNode(); | |
var input = this.refs.giraffe; | |
alert(input.value); | |
} | |
}); | |
// basis.js | |
var Zoo = basis.ui.Node.subclass({ | |
template: | |
'<div>Giraffe name: <input b:ref="giraffe" /></div>', | |
// or | |
// '<div>Giraffe name: <input{giraffe} /></div>' | |
showName: function() { | |
var input = this.tmpl.giraffe; | |
alert(input.value); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Чем проще, тем популярнее
basis.ui.Node.subclass
vsReact.createClass
)