I'm trying to find the proper way to
define some components which could be used in a generic
way:
value="2">
There
is a logic going on for rendering between parent and children components of course, you
can imagine and
as an example of this
logic.
This is a dummy implementation for the
purpose of the question:
var
Parent = React.createClass({
doSomething: function(value) {
},
render: function() {
return
({this.props.children});
}
});
var Child = React.createClass({
onClick:
function() {
this.props.doSomething(this.props.value); // doSomething is
undefined
},
render: function() {
return ( onClick={this.onClick}>
No comments:
Post a Comment