Upgrade to Pro — share decks privately, control downloads, hide ads and more …

React: Learn once, write everywhere

Cássio Souza
September 18, 2015

React: Learn once, write everywhere

Cássio Souza

September 18, 2015
Tweet

More Decks by Cássio Souza

Other Decks in Programming

Transcript

  1. • Self-­‐contained,  concern-­‐specific   building  blocks • Allows  a  “divide

     and  conquer”   approach  where  no  particular  part   needs  be  especially  complex Componentization
  2. • Requires  compilation  /   transpilation  step • It’s  plain

     javascript  -­‐ It  doesn't  alter   the  language  semantics.
  3. • It’s  plain  javascript  -­‐ It  doesn't  alter   the

     language  semantics. • XML  is  great  for  representing  UIs  in   element  trees  with  attributes. • It’s  more  concise  and  easier  to   visualise  the  structure  of  your   application.
  4. • Templates  encourage  a  poor   separation  of  concerns •

    Display  logic  and  markup  are   inevitably  tied  together.  They’re   highly  cohesive. • Keeping  components  small  and   single-­‐purposed  lead  to  separation   of  concerns
  5. • Every  time  state  is  updated,  it  is   guaranteed

     to  be  up-­‐to-­‐date. • No  magical  data  binding. • No  model  dirty  checking • No  more  explicit  DOM  operations  – everything  is  declarative. Just  Render  the  State.  Every  Time.
  6. In-­‐Memory  lightweight representation of the DOM In-­‐Memory  lightweight representation of

    the DOM On  Every  Update: • React  builds  a  new  virtual  dom   subtree • Diffs  the  new  tree  with  the  old  one • Computes  the  minimal  set  of  DOM   operations • Batch  executes  all  updates