Home > Software design >  React Typescript: Antd Checkbox value not working
React Typescript: Antd Checkbox value not working

Time:12-22

Hello im trying to fill the Checkbox value with my state but it dont accept it.

The Checkbox Code:

<Form.Item label="Aktiv" >
    <Checkbox value={this.state.selectedRecord.active} />
</Form.Item>

Value of the state selectedRecord: enter image description here

CodePudding user response:

try changing it to this.

<Checkbox checked={this.state.selectedRecord.active} />

  • Related