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

Borrowing Concepts from React to Build Dynamic ...

James Kerr
July 19, 2024
250

Borrowing Concepts from React to Build Dynamic Forms in Rails

Learn the concepts that made React so popular, then learn how to build a highly dynamic user interface with only the default Rails stack.

James Kerr

July 19, 2024
Tweet

Transcript

  1. “The most dif fi cult thing to do in the

    front-end right now is updates.” - Jordan Walke (2012, right before creating React )
  2. React There are two reasons for a component to render:

    1. It’s the component’s initial render. 2. The component’s (or one of its ancestors’) state has been updated.
  3. It watches for link clicks and form submissions, performs them

    in the background, and updates the page without doing a full reload.
  4. If a page re-render’s itself, Turbo will “morph” the HTML,

    only changing what’s different between the old and new.