» Posts by Kyle Truong

Unit Testing React, Redux, Selectors, and Epics

Written by Kyle Truong

How does unit testing work for front-end React-based applications in 2017? Testing React Components Components can be tested with snapshot testing. Tools like Jest (often combined with Enzyme) that offer this functionality take a ‘snapshot’ of what your component renders--everything from divs, attributes, classNames, props, and state--and saves it to a file, kind of like this: On subsequent test runs, Jest takes a new snapshot...

Read More »

Creating Forms with Redux: Part II

Written by Kyle Truong

In Creating Forms with Redux Part I, we hooked up our forms to Redux, learned about the reduxForm HOC and Field component, styled our forms, and made a custom input component. In this section, we continue creating reusable components for the most common form widgets, learn how to do field-level validation, and dive a bit deeper into the built-in action creators and selectors to help...

Read More »

Creating Forms with Redux: Part I

Written by Kyle Truong

There are few things less appealing than forms but they’re still one of the most direct ways for a user to dump a hunk of data into your server. To make the process of filling a form as painless as possible, one needs a good form system that handles common concerns such as: Handling field and form data Validation Submission Integration with the rest...

Read More »