Skip to content

Instantly share code, notes, and snippets.

@marcelowa
Created October 6, 2016 12:43
Show Gist options
  • Save marcelowa/45d7f4378ec15e424fb5353d0210c3f8 to your computer and use it in GitHub Desktop.
Save marcelowa/45d7f4378ec15e424fb5353d0210c3f8 to your computer and use it in GitHub Desktop.

React is a component library

jsx vs html

render
getInitialState
componentWillMount *
componentDidMount
componentWillReceiveProps
shouldComponentUpdate
componentWillUpdate *
componentDidUpdate *
componentWillUnmount

(*) Not commonly used by me

props vs state:

props: read only in the component, can be modified from the outside by passing them to the component
state: controlled from the component itself

Synthetic events

Flux

dispatch-action -> store changes -> view changes
view dispatch-action -> store changes -> view changes

store:

Single (source of truth)
Read only (update using actions, through reducers)
actions
reducers
middlewares
react integration
async problem

React router

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment