How to use the timm.addFirst function in timm

To help you get started, we’ve selected a few timm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github guigrpa / mady / src / client / components / 900-select.js View on Github external
render() {
    const { fAllowNull, value, options } = this.props;
    const finalOptions = fAllowNull
      ? timm.addFirst(options, { value: '_NULL_', label: '' })
      : options;
    const otherProps = omit(this.props, [
      'fAllowNull', 'onChange', 'value', 'options',
    ]);
    return (
      <select value="{this.toInternalValue(value)}">
        {finalOptions.map(o =&gt; (
          <option value="{o.value}" id="{String(o.value)}">{o.label}</option>
        ))}
      </select>
    );
  }