var condition = true; var props = { value: 'foo', ...(condition && { disabled: true }) }; var component = <div {...props} />; // Or var condition = true; var component = ( <div value="foo" {...(condition && { disabled: true })} /> );