How can I sort table in Reactjs with data from Api and data are sort via column?

enter code here Hello Comunity, Im strugeling with sortable table in react. I tryed a lot of codes and all if them kind of work but not properly, Please help.

  1. I dont know why ? Afte I clicked on the header of table I get the right name of column, but the column is sorted by id of the all table.

  2. What I whish, it should do after click: column name should be sort like this
    anke,karel, xena or xena, karel, anke

  3. my result is:

    [{id: 123, name: karel, age: 25}] [{id: 124, name: xena, age: 25}] [{id: 125, name: anke, age: 25}]

Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.