This line in example 7 index.js confuses me:
isSelected && <Inspector { ...{ setAttributes, ...props} } />,
As I understand it the ...
spreads out all the elements inside an array or object so [1, 2, 3]
would return 1, 2 and 3.
But to then to create a object literal with a spread array inside it and then to spread the object itself, yeah, that confuses me.
This has all come about because I actually want to pass another argument to the Inspector, but can’t figure out how.
I’ve tried:
isSelected && <Inspector { ...{setAttributes, ...props, { editor: this.editorInstance } } } />,
and
isSelected && <Inspector { ...{setAttributes, ...props }, { editor: this.editorInstance } } />,
but neither seems to work…(!)
Thanks.