Tutorials

Learn React, React Native, JavaScript and more with in-depth tutorials.

Emotion

How to use jest-emotion and react-testing-library to Test Emotion Component Styling

There are times where an animation can only be achieved by a component always being rendered. This could drive important business logic, however there may not be an easy way to test this when paired with a CSS-in-JS library like Emotion. We'll use jest-emotion to add in new matchers to Jest and combined with react-testing-library we'll be able to test our components are rendering the correct styling.
React

Creating a Reusable Window Event Listener Hook with useEffect and useCallback

In this lesson we'll dive into issues with creating class components for reusable logic. Then we'll convert the logic to take advantage of hooks. We'll step through each pitfall that could be encountered and how to solve them. We'll end up with a perfect solution and understanding for how to combine multiple hooks like useEffect and useCallback.
React

Create the James Bond Introduction in CSS and React

In this lesson we'll explore the concept of transitions and animations. We'll create circles that span the width of the screen. Then using transitions create a circle that moves at a linear pace across the screen. Finally using animation and animation delays we'll stagger the appearance and disappearance of each circle.
React Native

Build an Animated Page Indicator using Animated Dynamic Value Tracking in React Native

In this lesson we'll build an animated page indicator with React Native. We'll use Animated and Animated math functions to create animations that can be used with useNativeDriver. We'll then look at how to use a second Animated.Value and setValue to create dynamically tracked animations.
React

Animated Input Label with Chrome Autofill Detection in React

In this lesson we'll create a label that is centered inside of a text input. We'll look at how to detect Chrome is autofilling the input using CSS animation and CSS pseudo classes. When the input is autofilled, focused, or filled in we show how to animate the label to its resting place a top the input.
React

Build an Animated Page Indicator with Hooks in React

In this lesson we'll build an animated page indicator with React class component. We'll use state, and basic math to setup transforms to allow for automatic page animations even across multiple page changes. Then we'll convert the class component to take advantage of React hooks including useState, useEffect and useRef.
React

Create a Snapping Image Swiper like Instagram with React

In this lesson we're going to build an image swiper that works on web and mobile. We'll use a similar technique to Instagram and create a div that hides all overflow and translate an inner container left/right. We'll add in the ability to detect what image the user is looking at and snap to that image.
React Native

Create a Segmented Auto-Moving SMS Code Verification Input in React Native

In this tutorial we're going to build a segmented verification input that will automatically advance while you type. It will be a configurable length and automatically stop when the user has typed the maximum allowed length. We will also take advantage of React controlled inputs to read text changes but never display anything in the input.
React

Create a Segmented Auto-Moving SMS Code Verification Input in React

In this tutorial we're going to build a segmented verification input that will automatically advance while you type. It will be a configurable length and automatically stop when the user has typed the maximum allowed length. We will also take advantage of React controlled inputs to read text changes but never display anything in the input.
React Native

Create a Custom Animated Bottom Action Sheet without Measuring in React Native

We'll explore how we can create a custom action sheet in React Native that will animate visible/hidden without measuring any of the views. The technique will use absolute positioning, translation, and interpolation. The backdrop will quickly animate upwards before fading in. We'll position the action sheet container off screen, then translate the action sheet on the screen. This allows us to not have to measure any of the inner content.