What do props help us accomplish?
props help us render things that have the same format but different content
Make a component more reusable..
How do you pass a prop into a component?
you write prop as an argument and then use prop.name for example?
<MyAwesomeHeader title="???" />
Can I pass a custom prop (e.g. blahblahblah={true}
) to a native
DOM element? (e.g.
No, because the JSX we use to describe native DOM elements will
be turned into REAL DOM elements by React. And real DOM elements
only have the properties/attributes specified in the HTML specification.
(Which doesn't include properties like blahblahblah
)
function Navbar() {
return (
<header>
...
</header>
)
}
just simply put props
props
when the component receives it?