I want to conditionally set a Form.Input depending on selectedProfile if it is not null, it will set the Input as readOnly but if not then it won't.
this is my code and of course it didn't work. It would be easier if it's like readOnly = true but it's not
render() {
let readOnly = _.isNil(selectedProfile) ? "" : 'readOnly';
return (
<Form>
<Form.Input
fluid
required
label="First name"
placeholder="Jose"
name="firstName"
value={ _.isNil(selectedProfile) ? this.state.firstName : selectedProfile.first_name }
onChange={this.handleChange}
{readOnly}
/>
</Form>
for more info on readOnly, here's semantic ui react's docs about it.