Introduction to Using React with Rails
Explore how React works within Rails to add interactive, stateful components using JSX. Understand the differences between React and Stimulus, and learn how React manages state and updates the DOM automatically to enhance user experience.
We'll cover the following...
Introduction
React has emerged as the most popular of the current JavaScript frameworks, with a large ecosystem and user base. Structurally, React is the polar opposite of Stimulus. It is more complex, and its design reflects fundamentally different assumptions about how to manage state and logic in a JavaScript program. Specifically, a React application expects to get data from the server, managing state and HTML by manipulating the DOM on the client using a custom HTML-generation language called JSX.
For this course, we will only use a fraction of React’s capabilities. That is, we’ll focus on using React to support interactivity on a single page while working with ...