Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How ```valuePropName``` Works?

I have a form with checkBox component. But when I submit the form whithout valuePropName . The checkBox value is undefined

<Form.Item name="remember" valuePropName="checked">
          <Checkbox>Remember me</Checkbox>
        </Form.Item>

I get the value when valuePropName is setted.

I'd like to know the why and how valuePropName whorks.

like image 538
Alex Alan Nunes Avatar asked Oct 20 '25 11:10

Alex Alan Nunes


1 Answers

I think valuePropName specifies the name of the property that must be used as the value. For example, in the Checkbox component, valuePropName can be used to specify the name of the property that should be used as the value when the checkbox is checked. By default, this property is value, but you can specify a different property name by setting the valuePropName prop.

like image 197
arezoo hassannezhad Avatar answered Oct 23 '25 01:10

arezoo hassannezhad