I can't come up with a way to do it, but what I want is:
<ColumnDef key="label" ...createCommonColumnProps.call(this, {somestuff}) />
<ColumnDef key="count" ...createCommonColumnProps.call(this, {someOtherStuff}) />
<ColumnDef key="value" ...createCommonColumnProps.call(this, {yetOtherstuff}) />
I'm hoping it stupidly simple and I'm just being an idiot, but I can't find a way to do it without creating variables like
<ColumnDef key="label" {...column1} />
<ColumnDef key="count" {...column2} />
<ColumnDef key="value" {...column3} />
There are about 5 props, some of which are affected by the object passed to the function.
When I'm trying this in the chrome devtools console (just the js part, not the jsx part), I'm seeing things like this:
> function a() {
return {a:1, b:2}
}
undefined
> y = {... a()}
VM341:1 Uncaught SyntaxError: Unexpected token ...
> x = ... a()
VM368:1 Uncaught SyntaxError: Unexpected token ...
> x = {a:1,b:2}
Object {a: 1, b: 2}
> y = {...x}
VM888:1 Uncaught SyntaxError: Unexpected token ...