Dropdown menus allow you to declutter a web app and make navigation clean and intuitive. They allow you to fit dozens of potential selections within a small set of dropdown items. Building a React dropdown menu is a great way to learn React, so let’s get started! Building the Base Button We’ll first set up […]
While basic text, shapes, and colors are great, we often need more in our web apps. Images are much more complex arrangements of text, shapes, and color, and can add a lot to your React app. In this article, we’ll learn how to use them. To use images in React, we use the style attribute […]
React Hooks are a newly proposed feature that lets you use state and life-cycle methods without writing a class component.
useReducer is quite an advanced hook that beginners often don’t really know how to use. But this hook can be very useful for writing better and clearer code! If you’re not sure of what useReducer does, read on to learn more! What is the useReducer hook? You can think of useReducer as a “state” hook, […]
What is the `useRef` hook? How do you use it? When should you use `useRef` vs `useState`? What caveats should you be aware of when using `useRef`?
Build a form validation engine using custom React Hooks, from scratch, without having to learn a single form library. Read on to learn how!
Use custom React Hooks to build forms that require half the code to write, are reusable, and are much easier to read. Read on to learn more!
APIs and AJAX Requests in React
Sooner or later, every React developer needs to know how to make AJAX requests to fetch data from a server (make API calls). Let’s learn how!
Axios is a library used to make HTTP requests from the browser. Read on to learn how to use Axios with React to make API requests and display the response.
Building React Components
React allows you to build very complex applications. But as your applications grow in size, your code can become messy and difficult to build on. Sometimes, we’d like to split different React components into logically separated files. This act of separating functionality is a common operation in almost any programming language, from Python to C++. […]
Timers are very commonly used in React for all sorts of applications. They allow you to manipulate the order in which events occur. From the React Native Timer documentation, there are four types of timers: Timeout (delay) Interval (repeat with interval) Immediate (call as soon as possible) Animation (call when the browser is ready to […]
When you’re writing React components, you’re faced with a choice. Either functional components, or class components. Do you know what the similarities and the differences are? Which one should you use when?
React Event Handlers
‘onDrag’ allows you to execute a function when a user drags a component. It is passed as a JSX attribute. ‘onDrag’ Use Cases As its name suggests, ‘onDrag’ fires whenever a React component is being dragged. This can be useful in web apps that require drag-and-drop functionality, for example the famous work management app Trello. […]
To handle key presses in React, we use ‘onKeyPress’. It is passed as an attribute in <input> elements, and can be used to perform actions for any event involving the keyboard, whether you want to call a function on any key press, or only when a specific key is pressed. Why Use onKeyPress? Use Cases […]
There is no onHover event handler in React. Instead, we have the onMouseDown, onMouseLeave, and onMouseEnter events to perform onHover actions in React.
There are several ways to call muliple onClick events in React, each with its own pros and cons. Let’s explore each one and learn how they work in React!
A common thing you will want to learn in React is how to pass a value as a parameter through the onClick event handler. Read on to learn how!
The onChange event in React detects when the value of an input element changes. Let’s dive into some common examples of how to use onChange in React.
In React, the onClick handler allows you to call a function and perform an action when an element is clicked. onClick is the cornerstone of any React app.
Love Atom? Are you a front end developer? Then read on as I share the best Atom packages for front end developers (Updated November 2018).
It’s about time I shared my reasons why I came back to web development after five years of iOS development, and why I attribute a lot of these reasons to React.