• Home
  • About
    • Bio
    • CV
  • Music
    • Shows
    • Works
  • Research
    • Works
  • Programming
    • Projects
  • Blog
    • Watson
    • Viget
  • Contact
    • Message
    • Subscribe
    • Availability

React

08 Jul 2016

Reading time ~1 minute

What I Did

  1. Sat in on several intern group project meetings: copy review, design review, and FED/Dev coordination.
  2. Paired with Eli to clarify how to integrate CK into “These Numbers Matter”
  3. Spent the rest of the day on a React tutorial.

What I Learned

  1. Guidelines for React components (FIRST)
    • Focused
    • Independent
    • Reusable
    • Small
    • Testable
  2. A pure function is stateless - may not make Ajax requests. Within React, they should simply receive work with the state and props to render a UI’s (the presentational aspects of components as opposed to the functional aspects of components).
  3. The life cycle events of any given component can be distilled into two major categories: 1. Mounting/Unmounting 2. Updating Data
    • Mounting/Unmounting
      • Establish default props
      • Set initial state
      • Make Ajax request to fetch some data needed for a component
      • Set up listeners (Websockets/Firebase listeners)
      • Remove listeners you initially set up when unmounted
    • Updating Data
      • ComponentWillReceiveProps
      • ComponentShouldReceiveProps
  4. this in JavaScript is used in the following context:
    • Implicit binding (most common)
    • Explicit binding
    • New binding (constructor functions)
    • Window binding (default)
  5. Axios functions return promises.
  6. It’s good practice to add .catch at the end of promise chains.
  7. PropTypes serves a similar function to strong parameters in Rails in that both ensure correct types and are self-documenting to an extent.

What I Still Don’t Understand

I’m still slightly unclear on how exactly to link my Colonel Kurtz instance to the admin interface for “These Numbers Matter”, but that will hopefully become clear as soon as I’ve got Viget’s sample Acme app to riff of of.

What I’d Like to Learn

Though I’ve only studied it for about 2 days, I’m getting pretty excited to further explore React as well as JavaScript for that matter.



Share Tweet +1