JosieAilsa / react-fundamentals-recap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Props:

Just render UserInput to App.js.

To recap props:

  • Show that rather than adding "Name" for the label, we make the component reusable we can pass down the label for the input as props.
  • Think about how we could add a class in same way using the input--highlight

State:

Show state isolated within the UserInput component, get student to show it adding onChange to the h2 under neath the form.

Functions as props:

We need to know what the userName is elsewhere in our app, so move this state up a level.

Tying it all together:

  • Now look at the DisplayMessage component.
  • Figure out how we can put all these pieces together to find out what the user's name and animal is then render it with our DisplayMessage component.

About


Languages

Language:JavaScript 48.9%Language:HTML 30.6%Language:CSS 19.2%Language:SCSS 1.4%