I have a group of props that I need to apply to a component only if a certain condition is met.
So I grouped the props in an object:
const props = {
a: "",
b: "",
};
And then tried to conditionally apply them to the component:
<div {condition && ...props}/>
But React doesn't seem to be allowing this, so is there another way?