Last active
December 14, 2015 10:37
-
-
Save jedrekk/5da63a14f1faaf0deb86 to your computer and use it in GitHub Desktop.
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
var Input = React.createClass({ | |
render() { | |
<input onFocus={ this.props.changeClassFunc } /> | |
} | |
}); | |
var OuterDiv = React.createClass({ | |
changeClass() { | |
this.setState({ addClass: true }); | |
}, | |
render() { | |
var classes; | |
if (this.state.addClass) { | |
classes = "added-css-class" | |
} | |
return (<div> | |
<Input changeClassFunc={ this.changeClass.bind(this) } className={ classes } /> | |
</div>) | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment