[SOLVED] Ant design form + React createContainer


#1

Hello! , I’m starting with Ant Design and could show forms properly but I can’t make submit form works.

I’m using the Meteor React tutorial approach (createContainer), but I can’t access to validateFields antd Method

I read form must be wrapped like this :

const WrappedDynamicFieldSet = Form.create()(DynamicFieldSet);

But I dont know where to put that line in my code.

I tried at the end of my form but didnt work

export default createContainer(({params}) => {
  const itemsSub = Meteor.subscribe('currentUser');
  const ready = itemsSub.ready();
  const user = Meteor.users.findOne({_id: Meteor.userId()});
  const userExist = ready && !!user;
  const WrappedFieldSet = Form.create()(CustomersForm);
  //console.log(user);
  return {
    ready,
    customers: (userExist) ? user.customers : []
  }
},  WrappedFieldSet);

My module declaration looks like this:

export class CustomersForm extends Component {

Thanks


#2

I was close.


export default createContainer(({params}) => {
  const itemsSub = Meteor.subscribe('currentUser');
  const ready = itemsSub.ready();
  const user = Meteor.users.findOne({_id: Meteor.userId()});
  const userExist = ready && !!user;

  //console.log(user);
  return {
    ready,
    customers: (userExist) ? user.customers : []
  }
},  Form.create()(CustomersForm));