The React framework’s component-based approach makes managing large projects simpler. By making it easier to break functionality down into logical pieces that are encapsulated, the framework makes it easier for developers to manage. With that in mind, there have been a lot of choices when it comes to styling your React application. One approach is styled-components. This is a really …
There are two ways to create React components, using functions or classes. A common question when learning React is often “When do I use which?” Luckily, this is a question that might eventually become obsolete with the release of React version 16.8 as it includes hooks.
Hooks provide a way to use functionality such as state and context that could only be achieved through classes previously to be easily done with functional components.
In this blog, we’ll introduce React hooks and show some code examples of those hooks in action. Specifically, we will take a simple class component and convert it to a function with hooks, have an in-depth look at hooks useState and useEffect, and create a custom hook. Let’s get started!
There are many options when it comes to managing the state of a React application. Choosing the right one for your application can feel daunting.
The most popular choice, Redux, is often thought of as verbose because it requires a lot of boilerplate code, thus slowing down development. Redux is also very opinionated so it will take time for those unfamiliar with its functional programming paradigm to become comfortable with it.
In this blog, we’ll take a closer look at an alternative that aims to solve issues in React application state: MobX. To do that, I built a simple calorie counter application that will be used to showcase MobX in use.