title: Ant Design form set values form props
body: <p>I'm using <code>antd</code> design in my form. </p>
  
  <p>Here I'm setting value from reducer <code>profilereducer</code> by using <code>shouldComponentUpdate</code> method. </p>
  
  <pre><code>class ProfileForm extends Component {
  
   componentDidMount = () =&gt; {
    this.props.actions.getprofile()
   }
  
   shouldComponentUpdate = (nextProps) =&gt; {
    if (this.props.profile) {
     this.props.form.setFieldsValue({
      name: this.props.profile.name,
     });
    } else {
     this.props.form.setFieldsValue({
      firstname: 'loading',
     });
    }
   }
  
  
   render() {
    const { getFieldDecorator, getFieldValue } = this.props.form; 
       &lt;Form layout="vertical"&gt;
          &lt;FormItem label="First Name" &gt;
              {getFieldDecorator('name', { rules: [{ required: true, message: 'Required!', }], })(
                  &lt;Input addonBefore={selectBefore} placeholder="First Name" /&gt;
              )}
          &lt;/FormItem&gt;
      &lt;/Form&gt;    
  }
  
  
   function mapStateToProps(state) {
    return {
     profile: state.profilereducer.profile,
    }
   }
  
   function mapDispatchToProps(dispatch) {
    return {
     actions: bindActionCreators(actions, dispatch)
    }
   }
  
   const Profile = Form.create()(ProfileForm);
  
   export default connect(mapStateToProps, mapDispatchToProps)(Profile);
  }
  </code></pre>
  
  <p><strong>Error:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/EiicS.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/EiicS.jpg" alt="enter image description here"></a></p>