Skip to content

Instantly share code, notes, and snippets.

@justgage
Last active July 19, 2017 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justgage/7998b7aecef85c6c293ad4fd473e7a68 to your computer and use it in GitHub Desktop.
Save justgage/7998b7aecef85c6c293ad4fd473e7a68 to your computer and use it in GitHub Desktop.
A Take home for the into

React Presentation

Super excited for this new ORiley Book Ref: https://twitter.com/wesbos/status/598144948559605760/photo/1?ref_src=twsrc%5Etfw&ref_url=http%3A%2F%2Fchibicode.com%2Freact-js-introduction-for-people-who-know-just-enough-jquery-to-get-by%2F

High Level

DOM is state

Try1: JQuery

  • manipulates state directly
  • State is in DOM (a bad database) / Server side?
  • Wild West

Try2: Angular (1)

  • State is on both places! Kinda.
  • Really slow and error prone

Try3: React

  • State is in one place and let me take care of the state transitions efficiently

Basically how it works

  • React's model
    • Declare view based on props / state
    • Re-runs render function when state changes (and a few other things)

React Example:

  • Counter with two buttons.
  • Use Create React App:
npm install -g create-react-app
create-react-app my-app
cd my-app
npm start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment