...

/

Installing and Testing React

Installing and Testing React

Learn to install and test React in our Ruby app.

We need a dynamic form that changes what fields are shown based on what pay type the user has selected. While we could cobble something together with jQuery, it would be cleaner if we could use a more modern JavaScript library like React. This will also form a solid base from which we can easily add additional features later.

Using JavaScript libraries or frameworks can often be difficult, as the configuration burden they bear is far greater than what we’ve seen with Rails. To help us manage this complexity, Rails includes Webpacker, which provides configuration for Webpack. Webpack is a tool to manage the JavaScript files that we write. Note the similar ...