Skip to content

jeremyk/react-bootstrap-inputs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-bootstrap-inputs

This package is a small wrapper around react-bootstrap form components, that provide onChange callbacks to persist data.

Usage

The high-level onChange function call works as follows:

onChange(fieldName, value) {
    var change = {};
    change[fieldName] = {$set: value};
    this.props.onSetObj(update(
            this.props.obj, change));
}

Via mapStateToProps, this function will be passed down to any view using these components and you can use them as follows:

TextInput

<TextInput key={idx}
    obj={this.props.currentCommand}
    label={command.label}
    placeholder={command.placeholder}
    onChange={self.onChange}
    name={command.name}/>

SelectInput

<SelectInput key={idx}
    obj={this.props.currentCommand}
    label={command.label}
    choices={command.choices}
    placeholder={command.placeholder}
    onChange={self.onChange}
    name={command.name}/>

CheckInput

<CheckInput key={idx}
    obj={this.props.currentCommand}
    label={command.label}
    placeholder={command.placeholder}
    onChange={self.onChange}
    name={command.name}/>

About

Wrappers around react-bootstrap form inputs to persist data.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 98.2%
  • Makefile 1.8%