Saw this design:

<Component {...props} anotherprop={ab} /> 

What should be the structure to send the values? A simple object does not fit ...

Pointed in the tags React.js, for perhaps the principle is similar.

    1 answer 1

    Everything should work out of the box. That is, the following code constructs will be valid and should not lead to an error. The first option is to pass an array as a proxy:

     <Component arrayProperty={['one', 'two', 'three', 'four']} /> 

    The second option, for example, we have an array in the stack, we can simply transfer it there by specifying the name of the variable in which the array is located:

     constructor(props) { super(props); this.state = { arr: ['one', 'two', 'three', 'four'] } } ... <Component arrayProperty={this.state.arr} /> 

    With a steate it was shown simply as an example. Similarly, it can be a property of an object in which an array, or a static property of a component. Whatever, everything will work. You can even write a map instead of a variable, everything will work out.