If you want to achieve this, you can utilize the attribute spread operator:
let options = condition ? {selectedIndex: 2} : {};
let select = <select {...options} />
Alternatively, you may refer to their official documentation Guide
For instance:
React has consistently offered a JavaScript-focused API for the DOM. As React components often require both custom and DOM-related properties, React follows the camelCase convention similar to DOM APIs:
<input autoFocus={true} /> // Similar to node.autoFocus DOM API
<textarea placeholder="Enter text" /> // Similar to node.placeholder DOM API
<a href="https://www.example.com" /> // Similar to node.href DOM API
These properties behave much like their corresponding HTML attributes, except for the outlined special cases.