How To Sort A Table In React (No Libraries)

preview_player
Показать описание
Sorting a table with React JS is simple, just watch this short video and learn how.

In this 5-minute video, we'll cover the basics of sorting tables in React. You'll learn how to sort data in ascending or descending order and how to make your tables more user-friendly. Whether you're a beginner or an advanced React developer, this tutorial is a must-watch.

Feeling extra generous and want to help support the channel? (Thank you in advance, for real)

💻 Links to the stuff I use (Affiliate Links 😄)

⏱️ Timestamps
00:00 - Intro
00:15 - Adding functionality to Table
02:11 - Caret Icon
02:20 - CSS
02:29 - Back to the JSX
04:44 - Outro

Рекомендации по теме
Комментарии
Автор

Hey everyone, what would you guys like a video on next?

JacoblBroughton
Автор

Hermano, le voy a recomendar este video a cada persona que conozca. Ojalá los profesores explicaran así

onlyateenager
Автор

Hello Jacob, really liked the way you explained things keeping the video precise. This video was all that i needed rn. Thank you😃

jewelthomas
Автор

Nice vid Jacob! Can you try building a list, making its rows draggable? Something like React SortableJS

Dysfunctional
Автор

Hi Jacob! Thanks for this. Any chance you could share the code?

RachelJohnson-sqci
Автор

Okay, so this is a great video, short and sweet. However, it's still not working for me :(

Here's my problem - the site I'm working on right now is basically nothing but tables. Like, 8/9 links on the navbar go to a page with tables. Some pages have multiple tables separated by tabs! So because of this, I needed a custom table component that I can just slap everywhere and the data and headers are dynamic based on the needs of each page. I put it together a few months back and was like, I'll add sorting later! It's got so much going on including dynamic styling based on the type of data I'm passing in.

Since it's not a simple table like you have made I'm worried that part of the problem? Yours is the only success I've had, but it's still not correct. Basically, it takes two clicks on the header and what ends up happening is that it just reverses the order, but doesn't sort them.

I don't know if you can help me at all, but I'd really appreciate any advice you can give me!

timgoens