Search code examples
javascriptreactjstypescriptantd

React Typescript: Antd Checkbox value not working


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


Solution

  • try changing it to this.

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