react-list-input React component
npm install react-list-inputDo your users need to manage a list of stuff? Edit it? Drag it around?
Use this!
``javascript
import React from 'react'
import {render} from 'react-dom'
import ReactListInput from 'react-list-input'
const Input = ({value, onChange, type = 'text'}) =>
onChange(e.target.value)} />
class Demo extends React.Component {
constructor (props) {
super(props)
this.state = {
value: ['alpha', 'beta', 'gamma', 'delta', 'epsillon']
}
}
Item ({decorateHandle, removable, onChange, onRemove, value}) {
return (
StagingItem ({value, onAdd, canAdd, add, onChange}) {
return (
render () {
return (
onChange={value => this.setState({value})}
maxItems={10}
minItems={2}
ItemComponent={this.Item}
StagingComponent={this.StagingItem}
value={this.state.value}
/>
)
}
}
render(
``