I program the behavior of clicking on a row in the ant design Table component. This should change the rowClassName on the Table. Here is an example on CodeSendBox. When you click on a table row, the value in the Store.selectedRowKey changes, but the table is not re rendering. If you move the dividing slider to the sandbox and the table size changes, then rendering occurs and a new row selection is applied
Here's another example, where mobx don't work with ant-design Table
Ant Design Table with Modal form CRUD
I'm new in the Mobx I really want to understand what I'm doing wrong
To re-render an Ant-Design table, you have to pass the data-source value as a clone of the observable value.
you have to change
<Table
columns={columns}
dataSource={values}
/>
to the following code:
<Table
columns={columns}
dataSource={[...values]}
/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With