Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/forms / src / new-forms / plugins / LabelPlugin.tsx
Size: Mime:
import * as React from 'react'
import { observer } from 'xmobx/mobx-react'
import { InputProps } from '../inputs'

@observer
class LabelPlugin extends React.Component<InputProps> {
  static isSatisfiedByProps(props: { type: string }): boolean {
    return ['label'].includes(props.type)
  }

  render() {
    const { state, className } = this.props
    const {
      ref,
      htmlFor,
      label,
      labelText,
      ...remainingProps
    } = state
    return (
      <label htmlFor={htmlFor} className={className} {...remainingProps}>
        {labelText || label}
      </label>
    )
  }
}

export { LabelPlugin }
export default LabelPlugin