Current section: Lifting The State 29 exercises
Problem

Lift More State

Loading exercise

Transcript

00:00 All right, so we've got an interesting situation here. The users want a new feature. If I click on one of these like things, then the sorting here should actually depend on whether a post is liked. So, all the liked posts should show up first,

00:18 and then everything should be sorted from there, with the liked ones being first. So, this means that we're going to have to lift some state because that liked state right there, that's on the card by itself. We need to lift this up to be managed

00:33 by the state of the least common parent. So, I guess where the matching posts are, right? Like in that matching post component. So, we need to lift the state up there. That is your job in this exercise so that when users are searching through these and everything, the liked posts show up first.

00:52 That's what the users want, so we've got to do what they want. Have a good time.