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

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -