react-in-patterns icon indicating copy to clipboard operation
react-in-patterns copied to clipboard

A free book that talks about design patterns/techniques used while developing with React.

React in patterns

:books: A free book that talks about design patterns/techniques used while developing with React.

Book

React in patterns cover

Translations

Content

  • In brief

Foundation

  • Communication
    • Input
    • Output
  • Event handlers
  • Composition
    • Using React's children API
    • Passing a child as a prop
    • Higher-order component
    • Function as a children, render prop
  • Controlled and uncontrolled inputs
  • Presentational and container components

Data flow

  • One direction data flow
  • Flux
    • Flux architecture and its main characteristics
    • Implementing a Flux architecture
  • Redux
    • Redux architecture and its main characteristics
    • Simple counter app using Redux

MISC

  • Dependency injection
    • Using React's context (prior v. 16.3)
    • Using React's context (v. 16.3 and above)
    • Using the module system
  • Styling
    • The good old CSS class
    • Inline styling
    • CSS modules
    • Styled-components
  • Integration of third-party libraries
  • React and separation of concerns

Source code

The code samples used in the book are available here.

Other resources

Building the book

yarn install && yarn build

To make the ebook generating possible install calibre and ln -s /Applications/calibre.app/Contents/MacOS/ebook-convert /usr/local/bin/.