Talk given at Leeds JS in March 2017 covering topics such as state management, types of components, functional techniques and unit testing of React applications.
4. WHY REACT?
• UI as a representation of state (declarative)
• Simple to implement highly-interactive applications
• Just a library, offers flexibility of implementation
• Helps people become better JavaScript developers
• Easy to test
• Component approach encourages composition…
12. “Full scale React in production starts with small scale
React in production”
Paraphrasing Richard Feldman @rtfeldman
https://www.infoq.com/presentations/elm-producton
24. Try to always separate concerns correctly
Components that know about state shouldn’t output any dom and components
that know about dom should only rely on props provided
27. “Favor object composition over class inheritance…
...You should be able to get all the functionality you
need just by assembling existing components through
object composition.”
Gamma et al, 1994
28.
29.
30.
31. LOTS OF CONDITIONAL BRANCHING
IS AN INDICATION THAT A
COMPONENT NEEDS REFACTORING
CYCLOMATIC COMPLEXITY OF RENDER
FUNCTIONS SHOULD BEVERY LOW
58. Functions to handle state updates may well be the
idiomatic way to update in the future
https://medium.freecodecamp.com/functional-setstate-is-the-future-of-react-
374f30401b6b
82. THINGS TO BE EXCITED ABOUT*
*MAYBE THINGS JUST TO HAVE A LOOK AT
• ADTs (http://www.tomharding.me/2017/03/03/fantas-eel-and-specification/)
• Preact, Inferno, (Elm?)
• Tree Shaking
• React Router
• Next.js
• React Fiber (https://github.com/acdlite/react-fiber-architecture)