I often find myself doing something like this in my jsx:
myObject= {key1 : 'value1', key2 : 'value2'};
var reactElement = <MyReactElement key1={myObject.key1} key2={myObject.key2}/>;
Is there any infrastructure available that allows me to pass all the key pairs of values in my object as bearings on an element? I know that I can walk through the entire object, but it does not feel as elegant as possible, especially if this is the only thing that I go through, since then I need to turn to this.props.myObject.key1.
source
share