08 Jul 2016
Reading time ~1 minute
What I Did
- Sat in on several intern group project meetings: copy review, design review, and FED/Dev coordination.
- Paired with Eli to clarify how to integrate CK into “These Numbers Matter”
- Spent the rest of the day on a React tutorial.
What I Learned
- Guidelines for React components (FIRST)
- 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).
- The life cycle events of any given component can be distilled into two major categories: 1. Mounting/Unmounting 2. Updating Data
- 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
- Implicit binding (most common)
- Explicit binding
- New binding (constructor functions)
- Window binding (default)
- Axios functions return promises.
- It’s good practice to add .catch at the end of promise chains.
- 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