Topic

React tips

A topic with a resourceful collection of tips and ticks for React.


8 resources available

A guide to React refs: useRef and createRef

As is the case with many other UI libraries, React offers a way to rethink a view as the result of a state of a component. Part of that benefit comes from creating the views with the abstraction mechanisms React and JSX expose instead of doing it through DOM spec methods. Still, the React team did [continue]

Article by Jeremias Menichelli

6 tips for better React performance

In this article, I will try and list out a few easy ways to achieve better performance in your React app through simple development hacks. Under no means does this mean that you need to always apply these techniques, but it's always good to know that they are there. [continue]

Article by Aggelos Arvanitakis

7 Ways to Implement Conditional Rendering in React Applications

With React, we can build Single Page Applications that are dynamic and highly interactive. One way we fully utilize such interactivity is through conditional rendering. Conditional rendering as a term describes the ability to render different UI markup based on certain conditions. In React-speak, it [continue]

Tutorial by Philip Obosi

Using React Refs in Typescript

Sometimes it is necessary to use an imperative programming model and access an underlying DOM element. Whatever the reason this can be accomplished using React refs. This guide will show how to use strongly typed refs using Typescript. We will see how to use refs from functional components, using the [continue]

Tutorial by Chris Dobson

The most important lessons I’ve learned after a year of working with React

Starting out with a new technology can be quite troublesome. You usually find yourself in a sea of tutorials and articles, followed by millions of personal opinions. And every single one states that they found the 'right and perfect way.' Before diving into the ocean, we must understand the underlying [continue]

Article by Tomas Eglinskas

React performance tips. Make your React app fly!

React allows you to start building apps with ease, be it small and simple apps or big and complex apps. As applications evolve, it is only natural for requirements to do so as well and, in consequence, you will eventually need to boost some performance out of your app. In this article, we'll also look [continue]

Article by João Miguel Cunha

Conditional Rendering in React using Ternaries and Logical AND

There are several ways that your React component can decide what to render. You can use the traditional if statement or the switch statement. In this article, we'll explore a few alternatives. But be warned that some come with their own gotchas, if you're not careful. [continue]

Article by Donavon West

Evolving Patterns in React

Let's take a closer look at some of the patterns that are emerging in the React ecosystem. These patterns improve readability, code clarity, and push your code towards composition and reusability. In order to understand these patterns you need a basic understanding of the React concepts and its ecosystem. [continue]

Article by Alex Moldovan