Functional Components - KatyaHorton/Udacity-React-practice GitHub Wiki
- class
- function
Functional component receive it's properties as the first argument to the function.
Function -Arguments
Component - Props
class ListContacts extends Component {
render() {
return (
<ol>
{this.props.contacts.map((contact) => (
<li> ... </li>
))}
</ol>
)}}
function ListContacts (props) {
render() {
return (
<ol>
{props.contacts.map((contact) => (
<li> ... </li>
))}
</ol>
)}}
- Take in
props
as an argument - Return UI
- No
this
keyword