Search code examples
javascriptreactjstypescriptantd

Ant design Form.Item validation style


Is it possible to add a className prop to the Form.Item validation?

<Form.Item name="username" rules={[
   { required: true, message: '...' },
   className="customValidation" //<- something like that, but it is not working
]}>

Edit: Overriding the ant styles is not a valid solution!


Solution

  • I created a Issue on GitHub and and they answered with

    Form.Item supports className on it now.

    https://github.com/ant-design/ant-design/issues/34110