Whats the best way to conditionally add readOnly in React?
<input readOnly={this.props.boolean} />
This is ugly but it works:
{props.readonly ?
<input placeholder="Can't edit here" readOnly />
:
<input placeholder="edit here..."/>
}
Make the two controls custom to avoid duplicating as much as possible...