Functional components

One of the coolest things about React is that we can define our own components, and those components are just function. That’s correct, they’re just functions. So if we wanted to use this all over the place, and use it like this, as “Greeting”, we just wrap it in a function. So we’ll call this “function Greeting”. No arguments here, and return this “Hello, React!” h1. Now to prove I don’t have anything up my sleeve, I’m going to use that older function declaration syntax to do the same thing. [example]. Good to go! Now, I like this newer, kind of terse, syntax a little bit better, so let’s stick with that!

Play video: Functional components
  1. Course overview
  2. Project setup
  3. ReactDOM.render and React.createElement
  4. JSX
  5. 👉Functional components
  6. Props
  7. Class Components
  8. onClick and other events
  9. Component initial state
  10. setState - object form
  11. setState - functional form
  12. Conditional rendering in JSX
  13. essential react 13
  14. Fetching pokeapi data
  15. componentDidMount
  16. setState and fetch
  17. Lists with Array.map()
  18. componentWillReceiveProps
  19. Component props
  20. Render props
  21. Separation of Concerns with components
  22. Higher-order components
  23. defaultProps
  24. Render prop actions
  25. Course summary