score:0

the message in the rules can be a variable i would do it like below

<formitem>
  {getfielddecorator('username', {
    rules: [{ required: true, message: (errorfromserver || 'please input your username!') }],
  })(
      <input addonbefore={<icon type="user" />} placeholder="username" />
    )}
</formitem>

score:1

look at this example: https://ant.design/components/form/#components-form-demo-register

you can use customized validate method, and you can validate async, too.


Related Query

More Query from same tag