mardi 24 mars 2015

How do you implement "check all" in react with child components?

I've found a couple questions on here that sort of answer the question,



but they do not allow me to render a component with a checkbox.


What I'd like is something like this,



render: function () {
var rows = [<ChildElement key={1} />, <ChildElement key={2} />];
return (
<ParentElement>{rows}</ParentElement>
);
}


where my ChildElements each have their own check boxes that can be set to checked=true or checked=false whenever a global checkbox is checked or unchecked on the ParentElement.


Any suggestions? Cheers





Aucun commentaire:

Enregistrer un commentaire