Modify attributes of children in ReactJS component -
Modify attributes of children in ReactJS component -
i trying figure out how modify children of component example, add together class. have tried do:
var inputreactobject = react.children.only(this.props.children); inputreactobject.classname = "test";
however not seem work.
is possible modify children attributes in reactjs component?
full plunker: http://plnkr.co/edit/msbusdbqn17qxzbhzgxd?p=preview
as mentioned @lpiepiora plunker, code want be:
var inputreactobject = react.children.only(this.props.children); var clonnedchild = react.addons.clonewithprops(inputreactobject, { classname: "input-element test" }); homecoming clonnedchild;
reactjs
Comments
Post a Comment