Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Kalle Mäkynen
    Hey @davidkpiano. Is there some reasoning behind not "allowing" <Errors /> component's messages to be an object? The component works fine even if it is an object, but I get type error in the browser console: "Failed prop type: Invalid prop messages.isRequired supplied to Errors"
    @write2art ... yes I have and it works great with it. What questions do you have regarding it ?
    Emmanuel Villegas
    hi i need a hand with something
    is someone there?
    @kkashou how exactly have you achieved it? My setup is working, but seems a little bit sophisticated to me:
    class DatePickerInput extends Component {
      constructor (props) {
        this.state = {
          startDate: props.value ? moment.unix(props.value) : ''
        this.handleChange = this.handleChange.bind(this);
      handleChange(date) {
          startDate: date
      render() {
        return <DatePicker
          dateFormat="DD MMM YYYY"
          placeholderText="Выберите дату"
    export default class DatePickerControl extends Component {
      customInput(props) {
        return (<DatePickerInput {...props}/>);
      render() {
        return (
          <div className="form-group">
            { this.props.label &&
            <label className="control-label" htmlFor={}>{this.props.label}</label>}
            <Control {...this.props} className="form-control" component={this.customInput} getValue={(moment) => {
              return parseInt(isNaN(parseInt(moment)) ? moment.format("X") : moment);
    Billy Le

    Hello everyone! I'm fairly new to react and redux and my team is currently using react-redux-form. I have a question but there is some context before I ask.

    I have a form, say the model is 'team', that will make a request to retrieve all data from the db, say 'users', when the component mounts. This users data will have a list of id's and a names. I will map over the names over a dropdown list using the and the model will point be "".

    So what I want to do is use the id to pass in with every option because my model needs the "" to save to the db on submit. How is this done?

    David Khourshid
    why not map over the IDs to start with?
    and then display the names based on the IDs (but don't have the names be the values of the options)
    Billy Le
    Yeah, that's what I ended up doing :) Thanks tho! Took me another day to figure it out.
    @write2art That sounds about right how I would have done it. What part specifically are you looking at that is little bit sophisticated?
    Lukas Stuart-Fry
    Does anyone have any experience in writing debounced validators? All my ‘change’ actions are debounced 300ms, and I’m trying to figure out the best way to implement a 300ms delay on all my validators.
    Lukas Stuart-Fry
    I’m not handling validation through any manual dispatch actions.
    const required = () => ({ validator: (val) => (val && val.length) });
         validators: { required: required().validator }
    Lukas Stuart-Fry
    Actually, this was completely my error. I can leave this message here as a warning for others, but my Control field was actually using a validateOn=“blur” only. Since the model change was debounced 300ms, if a user ‘tabs’ or clicks out of the field before the model can update, it will register as invalid.
    Was there any breaking change between 1.14 and 1.16? I just upgraded and all of my wrapped controls broke. I can start digging in but if there's a documented upgrade guide would prefer to start there
    It now appears all of my props are being passed straight down to the <input>
    For example, <input label="Email Address" placeholder="Your email" controlprops="[object Object]" validators="[object Object]" messages="[object Object]" name="" value="" fieldprops="[object Object]" class="form-control">
    Appears it was actually between 1.14.2 and 1.14.4...
    Circling back to ^, it's a minor problem and logged here: davidkpiano/react-redux-form#1021
    Chris Gruel
    Hiya, could someone point me towards some examples of unit testing forms created with react-redux-form. I have a feeling I am over complicating it but would like a reference to be sure.
    David Khourshid
    @devorbitus look at the RRF unit tests. it's not too hard
    the process is just creating a store like you would with combineForms and then selecting inputs, and entering text into them, and checking that the store has the right value.
    Baruch Kogan
    hi, guys. Could anyone explain to me how to initialize field arrays with some field length? the example has a button that is linked to fields.push in the stateless method, but I'd like to start off with several fields, and can't figure it out
    David Khourshid
    @boriskogan81 wrong repo
    is there a way to not clear all the forms input when a reset button has been pressed?
    Christian Kaps
    What would be the best way to sanitize a value before it gets updated in store?
    Does anyone have an example of a custom component integrated with react-redux-form? We would like to see the implementation of the custom component which integrates with validatations on the form.
    Rich Buggy
    If I'm using LocalForm and I dispatch actions.submit("model-name") and everything is valid should it not result in the onSubmit handler being called?

    How can I change a field of LocalForm?

    <Control.text model=".text">

    <Control.text model=".text"
    David Khourshid
    What do you mean?
    Never Mind. I solved it with Github documentation. Actually, I didn't know how to change the model of LocalForm
    attachDispatch(dispatch) {
      this.formDispatch = dispatch
    handleSubmit(val) {
      this.formDispatch(actions.change('local.text', ''))
    <LocalForm getDispatch={(dispatch) => this.props.attachDispatch(dispatch)} />
    Field changes that affect other fields. What's the recommended way to update (normalize) the model after a field change? Would be great to have an actions.normalize(model, values => updatedValues )
    Brad Wertman

    I'm following the Quick Start guide for react-redux-form to add it to my react app with a redux reducer and store that are already in place. The redux createStore method keeps throwing an error "Object is not a function"

    import { createStore } from 'redux';
    import { createForms, combineReducers } from 'react-redux-form'
    import rootReducer from '../reducers/index';
    import userReducer from '../reducers/user';
    const initialUserState = {
      firstName: '',
      lastName: ''
    const store = createStore(
        root: rootReducer,
        user: userReducer,
    export default store;

    Any help as to what I may be doing wrong?

    David Khourshid
    Make sure you have that combineReducers in there too
    Brad Wertman
    @davidkpiano, it's there. Not sure what you mean. The error throws on the const store = line.
    Brad Wertman
    @davidkpiano Got it. I'm new to Redux in general and your Quick Start example didn't show where you imported combineReducers from. I presumed it was coming from react-redux-form instead of fromredux. It wasn't until I dove into the detail page ofcreateForms` that I caught it.
    Pavel Šindelka
    Hello guys! Am I able to set init values with dynamic redox-form fileds?
    I have updraged Babel packages and webpack packages to the latest one on my fork and if I do npm i and npm run build to my forked repo it works good and if i copy paste the package with my project node_modules it works. But if I try to use .git of my forked package to do npm install -S react-redux-form@forkedrepo.git here i dont see the umd and lib folders got it build automatically.. please suggest what could be the issue ...