DEV Community

Discussion on: React - how to create dynamic table

Collapse
 
undqurek profile image
undqurek

Sortable columns could be useful too.

Collapse
 
philiphassialis profile image
Philip Alexander Hassialis

Usually sortable columns are something done in backend. YMMV of course but past a certain point its actually more effective to do pagination and sorting in the database request since its optimized for this kind of work.

Collapse
 
hasnaindev profile image
Muhammad Hasnain

That ain't difficult, you just have to manipulate the data structure using selectors, a selector library like re-select to be more specific and run a sort method on the array.