Current section: Rendering Arrays 59 exercises
Problem

Key Reset

Loading exercise

Transcript

00:00 So one of the cool thing about the key prompt is that it can be used to actually tell react Hey, I want to take this element out or this component get that out of there Throw it away all of the state that it has get rid of it and then bring a new copy or new version of that thing

00:16 In its place and so that's what we're going to do here. This is not typically what you do You don't do this a lot, but this definitely is something that comes in handy sometimes when you want to reset The state of something so here I can say hello, and I hit reset nothing happens That's your job is to make that thing happen

00:33 But when you're all done the way that it should work is you'll notice the input gets a highlight Boom in fact the div also because it's child got replaced this input Just gets removed and set a new because it's key changed when the reset button gets clicked So that's your job is to make that work. Have a good day