How to reset antd table sorter to from ascending or descending to normal?

7.4k views Asked by At

I am working on a react component in which I am using Antd Table. Now I have sorted the columns to ascending order and now I have switched the table structure such that data in that column is according to new api but column name remain same. But in antd table column sorter icons are still showing green on upper arrow which means it is showing data in ascending sorted order but I want it to show no sorting when data is changed via api call.

1

There are 1 answers

0
Emilio On

You will need to keep in state the sortOrder and reset it when needed.

How to control sort order from the ant docs: https://codesandbox.io/s/wspmb

https://ant.design/components/table/