Tutorials

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

React

Build a Reusable Scroll List Component with Animated scrollTo in React

We'll show how to build a reusable ScrollView and ScrollElement component without adding any additional DOM elements. We'll take advantage of React.cloneElement, React.Children.only,findDOMNode, and context to build a registry of scrollable elements in the list. Then we'll use ref on the ScrollView to expose a way to animate to any item at any scroll position in the list.
React

Using Functions as Children and Render Props in React Components

We'll explore the concept behind child function components and how to add dynamic return values and hiding state management inside the component. Then we'll explore how to setup functional render props that allow for complex components with simple APIs. Finally we'll show how these 2 concepts can compose together like any other React component.
JavaScript

Use licensee.js to Check Dependencies for Accepted Library Licenses

In this lesson we'll use licensee.js to see how to configure accepted license types for our project. We'll also explore how to use whitelist overrides to allow specific libraries that may not match our license configuration. We'll also setup an npm script to show a more visible exit code 1 failure.
Node

Use babel-preset-env to Use Native Node Features and Also Use Babel Plugins

In this lesson we'll show how to setup a .babelrc file with presets and plugins. Then create npm scripts that use babel-node and babel. With babel-preset-env we'll show how to target specific versions of node and how to use babel plugins, while not transpiling features (like async await) that are already supported by node natively.
JavaScript

Use Yarn to Create an Alternative Import Name of an Installed Library

In this lesson we'll show how to use yarn to alias the names of same npm libraries but install different versions. This could allow for easy migrating from one library version to an upgraded version.
React Native

Use Local Files or Remote Video Files with React Native Video

In this lesson we'll show the different methods that react-native-video allows to play video including remote video files and local files imported as asset files by React Native.
React Native

Use FlexBox to Scale a React Native Background Image

In this lesson we will use Flexbox to scale a background image to fit on the screen of our React Native application.
React Native

Stagger React Native Animations with Animated.stagger

In this lesson we'll use Animated.stagger to stagger Animated.timing animations that animate the height of a React Native view every 300 milliseconds.
React Native

Show an Animated Buffering Icon When Remote Videos are Loading in React Native

In this lesson we'll show how to use icons from react-native-vector-icons. With absolute positioning we'll center the icon over the video. Then we'll use the Animated.loop call to rotate the icon continuously in a 360 degree loop. Finally we'll the stopAnimation call to pause the animation when we are no longer buffering.
React Native

Show An Error Message When A Video Fails to Load in React Native

In this lesson we'll show to use the onError callback from react-native-video. We'll show how to put a separate view to cover the video and render an error icon from react-native-vector-icons. Finally we'll add custom error messages based upon the error code returned.