Current section: Slots 30 exercises
Problem

Slot Context

Loading exercise

Transcript

00:00 So we've got a problem. I've got this input. We have a venue. And when I click on that venue label, it doesn't focus on the input like it should. So that is something that you're going to be fixing in this exercise. We have a text field component that is a slotable component, so it should have slots for label

00:17 and input. And the label and input slot components should associate themselves to the like with the html4 and an id so that those things can be associated. So when you're all done, you should be able to render a text field component and then inside of

00:35 that you can render a label and the input itself and they can take whatever additional props that that you want to provide them. It merges those things together. You can override things if you want to, so feel free to open up our app tsx right here and like customize the id and make sure that you can customize

00:55 that id. But the goal here is to make it so that the label and input are automatically associated with each other thanks to the slot contacts that the text field provides and the slots that it provides and the label and input consuming those slots

01:15 with the label consuming a slot called label and the input consuming a slot called input. Have a good time.