professional-programming/training/front-end/02-react.md
2020-10-06 11:26:09 +02:00

1.8 KiB

Table of Contents

An introduction to React

Recap of the previous session

See previous session

  • Arrow functions
  • Classes
  • let and const
  • Object and array destructuring
  • Template literals

Before getting into React...

Manipulating the DOM

Learning React

Follow the tutorial: https://reactjs.org/docs/hello-world.html

We have chosen this tutorial over the "learn by doing" one because it introduces the concepts behind React. It is very well done and very complete.

Exercise

Use one of our hiring exercises.

Self-assessment

Basics:

  • What is the difference between elements and components?
  • What is JSX?
  • Is it ok to modify props?
  • How should you modify state?
  • What does "the data flows down" mean?
  • How do you pass arguments to event handlers?
  • How do you put conditionals in JSX?
  • How do you put inline if-else in JSX?
  • How do you prevent a component from rendering?
  • What is the key prop?
  • What are controlled and uncontrolled components?
  • What does it mean to "lift state up"?
  • Should you use composition or inheritance with React?

Advanced: