This file contains hidden or 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
/** | |
* Based on http://stackoverflow.com/a/33585501/1783214 | |
* | |
* Handle resizing enclosed View and scrolling to input | |
* Usage: | |
* <KeyboardHandler ref='kh' offset={50}> | |
* <View> | |
* ... | |
* <TextInput ref='username' | |
* onFocus={()=>this.refs.kh.inputFocused(this,'username')}/> |
This file contains hidden or 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
# Since React has made jQuery obsolete for me, I use $ to replace JSX. | |
window.$ = React.create-element | |
for key, value of React.DOM | |
window."$#key" = value | |
# And here's an example of a render function using this syntax. | |
render: -> | |
$ Jumbotron, style: styles.welcome.base, [ | |
$h2 key: \tagline, 'this is a catchy tagline' | |
$p key: \mission, 'here is a short mission statement, expanding on the tagline' |