Prop Collections
Loading "Prop Collections"
Run locally for transcripts
π§ββοΈ I've removed the work we did with the Slot pattern and we're also going to be
focusing the next few exercises on the hook. So we've simplified things a little
bit to give us a better focus on the hook.
π¨βπΌ In our simple example, this isn't too much for folks to remember, but in more
complex components, the list of props that need to be applied to elements can be
extensive, so it can be a good idea to take the common use cases for our hook
and/or components and make objects of props that people can simply spread across
the UI they render.
In this exercise you need to create a
togglerProps
object that has all the
props people would typically need applied to a toggle button.