fmoo / react-typeahead

Pure react-based typeahead and typeahead-tokenizer
ISC License
677 stars 230 forks source link

Use with react redux form #233

Open charithAmila opened 7 years ago

charithAmila commented 7 years ago

I use this with react-redux form . It is working . when destroy the redux from typeahead is not destroy (clean)

const renderTypeaheadField = ({ input, label,options, type, meta: { touched, error } }) => (
    <div>
        <Typeahead
            options={options}
            maxVisible={10}
            {...input}
        />
        {touched && error && <span className="required">{error}</span>}
    </div>
)
componentWillReceiveProps(nextProps){
        if( nextProps.submitSucceeded  ) `{`
            nextProps.destroy('add-customer')
        }
    }