1. React
  2. React Boston
  3. 2019
  4. React and Elm Join Forces

React and Elm Join Forces

Jade Dickinson at React Boston 2019

The differences between Elm and React with Redux are often framed as a competition, but it doesn’t have to be that way. Coming to React as an experienced Elm developer, I’ll explore what the two share in order to help you better understand the design patterns behind both. I will talk about the problems that the Elm and Redux architectures solve. I will then outline how Elm’s flow compares to Redux’s unidirectional data flow, and describe the pros and cons I’ve seen different teams I’ve been on encounter when using Elm or React. I will also show how similar reducers in Redux are to Elm update functions, by doing a side-by-side comparison of the same component, built in both React with Redux and in Elm. Finally, handling synchronous events is built in to React, but there is no one way to handle side effects. I’ll give an overview of the main options for React - thunks, sagas, and observables - and will introduce the audience to redux-loop, which borrows from Elm’s commands. After this talk, you should have a better understanding of the choices behind the React-Redux and Elm architectures.