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    
ui-component-library / src / inputs / TextBox / deps / createGetFromPropsOrState.ts
Size: Mime:
import { hasOwnProp } from 'exotic'
import { TextBoxProps, TextBoxState, TextBoxComponent } from '../typings'

export function createGetFromPropsOrState(instance: TextBoxComponent) {
  return function getFromPropsOrState(key: string): any {
    return hasOwnProp(instance.props, key) ? instance.props[key] : instance.state[key]
  }
}