Passing Data Into a Component
What this is. Props are the arguments a component receives. You write them as attributes on the tag, and they arrive as one object.
This is what turns a component from a fixed piece of markup into something reusable.
Why destructure. You can take the whole object and write props.title everywhere. Naming the individual props in the parameter list instead means the first line of the component tells you exactly what it needs, which is the fastest documentation there is.
✦ Props are read-only
A component may never assign to its own props. React will not stop you, and that is worse than an error: the change is silently lost on the next render. If a value needs to change, it is state, which is the next module.
Mark this lesson complete
Signed in, your progress follows you to every device.