Development

React.js Development

Components, state, and a small React interface built from pieces.

★★★★★4.8 · Based on 143 learners64 lessons · 16 hr

React.js Development introduces components, props, and state, then uses them in a small interface. You should already be comfortable with HTML, CSS, and basic JavaScript. The lectures move in that order so a component is never a mystery box.

Course syllabus

  1. 01. Components

    • Why React splits the page

      A component is a function of data.

      15 min
    • A project you can run

      The start command, the page in the browser, and the file you will edit.

      17 min
    • A component is a function that returns UI

      The name, the return, and where it is used.

      13 min
    • Put the component on the page

      Render it once so you can see it.

      16 min
    • A second component

      A header and a main piece, not one giant function.

      18 min
    • A file per component when it grows

      The name of the file matches the name of the function.

      14 min
    • What stays out of the component

      A fetch you have not learned yet does not belong in the first file.

      18 min
    • The tree in one sentence

      App renders Header and Main. You can point at the screen and say which is which.

      12 min
  2. 02. JSX

    • JSX is the UI in the function

      Tags that become elements, inside the return.

      17 min
    • One parent

      A fragment or a div when you need two siblings at the top.

      15 min
    • A JavaScript expression in braces

      A variable shown in the text.

      16 min
    • A className, not class

      The attribute React expects.

      13 min
    • An image and a link

      The same ideas as HTML, in this syntax.

      15 min
    • A conditional in the render

      Show a line only when a value is present.

      17 min
    • Keep the return readable

      If it is a puzzle, split a component out.

      13 min
    • The HTML you already know still matters

      A button is a button. React does not rename the idea.

      16 min
  3. 03. Props

    • Props

      Pass information in, and keep the component reusable.

      18 min
    • A title prop

      The parent decides the words. The child displays them.

      14 min
    • A number prop

      Passed as a number, not pasted into a string by accident.

      18 min
    • Use the same component twice

      Two titles, one function.

      12 min
    • A prop with a default

      What shows when the parent does not pass it.

      17 min
    • Do not change props inside the child

      They are the parent's data.

      15 min
    • An object prop when the fields belong together

      A person with a name and a role, passed as one value.

      16 min
    • Name the prop for what it is

      label, not data1.

      13 min
  4. 04. State

    • State and events

      A value that changes when the person acts.

      15 min
    • useState

      The current value, and the function that sets the next one.

      17 min
    • A click that updates state

      The button calls the setter. The screen follows.

      13 min
    • Do not edit the state value in place

      A new value, passed to the setter.

      16 min
    • A count you can explain

      Starts at zero, increases by one, shown on the page.

      18 min
    • State lives in the component that needs it

      Not in a child that only displays.

      14 min
    • A second piece of state

      Only when it changes for a different reason.

      18 min
    • The screen is a result of the state

      If the number is wrong, the state is wrong. Do not patch the DOM.

      12 min
  5. 05. Events

    • An event function

      The function you pass to onClick.

      17 min
    • Pass the event only if you need it

      Often you only need to call the setter.

      15 min
    • An input's onChange

      The field and the state stay in step.

      16 min
    • A controlled input

      The value comes from state. The state comes from the field.

      13 min
    • Submit a form

      preventDefault, then use the state you already have.

      15 min
    • Disable a button while a value is empty

      The state decides. The attribute follows.

      17 min
    • A handler named for the action

      addItem, not handleClick2.

      13 min
    • One event, one job

      If the function does three things, say them in order inside it.

      16 min
  6. 06. Lists

    • Lists and conditional UI

      Render a collection, and show a different view when data is missing.

      18 min
    • Map an array to elements

      Each item becomes a component or a row.

      14 min
    • A key that identifies the item

      An id from the data, not the index, when the list can change.

      17 min
    • An empty list

      A sentence on the page, not a blank hole.

      11 min
    • Filter the array, then map

      The items you mean, then the elements.

      16 min
    • A missing item

      What the page shows when the id is not in the list.

      14 min
    • Do not mutate the array

      A new array from filter or a copy, then set state.

      15 min
    • The list is the data

      If a row is wrong, look at the array, not at the tag.

      12 min
  7. 07. A small screen

    • A small multi-part screen

      Compose components into one interface you can explain.

      14 min
    • The data you will show

      An array of three items, in state.

      16 min
    • A form component

      The field and the button, talking to the parent through props.

      12 min
    • A list component

      Receives the items. Does not own them.

      15 min
    • Add an item

      The parent appends to the array and sets state.

      18 min
    • The empty state you already planned

      Before the first item, the sentence is visible.

      13 min
    • Names of the components

      App, ItemForm, ItemList. You can point at each.

      17 min
    • What you would add next

      A remove button, named, even if you stop before building it.

      11 min
  8. 08. Care

    • A prop type you assumed

      If title might be missing, the component should survive it.

      16 min
    • A list key warning

      What it means, and the id that fixes it.

      14 min
    • State that resets

      A component that unmounts loses its state. Know where it lives.

      15 min
    • A file that got too long

      Move a component out when you scroll to find it.

      12 min
    • Read a component from the props down

      What comes in, what state it has, what it returns.

      14 min
    • The browser and the code should match

      If they do not, the state is not what you think.

      16 min
    • No fetch in this course's last file

      This course ends with data you hold. The next course can ask a server.

      12 min
    • Explain the screen in a minute

      The components, the state, and the event that changes it.

      15 min

Lecture videos stay with the course. Playback for enrolled students will open once payments are available. Video links are not published on this page.