When creating a new React application, we think about redux as a state management solution as a default choice. Let’s have a look at the Context API as a possible replacement. If you’re building a new React app today, your instincts may urge you to choose Redux. But should you start with Redux? That has turned into a legitimate question these days. The state management capabilities of React have vastly increased in recent versions. I’d want to discuss a more straightforward technique that relies on the Context API in this post. Let’s Take a Look Back Why Did We Adopt...
A Contemporary Guide on React State Patterns in 2021
Since the initial release of React in 2013, Facebook has rolled out a robust collection of tools to help developers with some of the minutiae of the web application development process, allowing them to focus on what matters most. Despite React’s many capabilities and widespread adoption among developers, I’ve discovered that many of us face the same question: How can we handle complicated states with React? You may like: Crud Using React Hooks and Context API This post will look at what state is, how to arrange it, and alternative patterns to use as our applications become...
Crud Using React Hooks and Context API
React Hooks and Context API are two relatively new features that have been added to React from v16.8 and v16.3 respectively. In this post, I'm going to create an app that can perform CREATE, READ, UPDATE and DELETE utilizing Hooks and Context API together.This new concept was introduced in v16.8 which is an alternative to classes. The Devs who used React before are familiar with functional components and class components. Many of these features available to classes - such as lifecycle methods and state weren't available to React until Hooks were introduced. The new Hooks add those class...