Does React.js support HTML5 datalist?
I'm currently using the html5 datalist in react without issues.
Here goes the implementation:
<input type="text" list="data" onChange={this._onChange} />
<datalist id="data">
{this.state.data.map((item, key) =>
<option key={key} value={item.displayValue} />
)}
</datalist>
Datalists work fine in React, but you must close each option tag (with a backslash at the end).
<option value="something" />
It takes a little change to make MDN datalist example works in React.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist
<label>
Choose a browser from this list:
<input list="browsers" name="myBrowser" />
</label>
<datalist id="browsers">
<option value="Chrome" />
<option value="Firefox" />
<option value="Internet Explorer" />
<option value="Opera" />
<option value="Safari" />
<option value="Microsoft Edge" />
</datalist>