---
title: "Mark Erikson (@acemarke) | Hashnode"
description: "I write code :). Read the latest articles by Mark Erikson on Hashnode."
url: "https://hashnode.com/@acemarke"
---

@acemarke

# Mark Erikson

@acemarke · Joined July 2016

I write code :)

## Comments

[Hi, I'm a Redux maintainer. Please note that "modern Redux" code is very different than what most older tutorials show. We've introduced newer APIs like Redux Toolkit, which is a set of utilities that provide a light abstraction to simplify the most common Redux tasks, and the React-Redux hooks API, which is generally easier to use than the traditional connect API. I strongly recommend reading through the newly rewritten official tutorials in the Redux docs, which have been specifically designed to teach you how Redux works and show our recommended practices: "Redux Essentials" tutorial: teaches "how to use Redux, the right way", by building a real-world app using Redux Toolkit "Redux Fundamentals" tutorial: teaches "how Redux works, from the bottom up", by showing how to write Redux code by hand and why standard usage patterns exist, and how Redux Toolkit simplifies those patterns The older patterns shown in almost all other tutorials on the internet are still valid, but not how we recommend writing Redux code today. You should also read through the Redux "Style Guide" docs page, which explains our recommended patterns and best practices. Following those will result in better and more maintainable Redux apps. In addition, the easiest way to start a new project is with the official Redux+JS template for Create-React-App. It comes with Redux Toolkit and the React-Redux hooks API already set up when the project is created.](https://hashnode.com/posts/how-i-learned-redux/5ff7294baa5c467fe15565b4/comment/5ff79f24aa5c467fe1556cfa)

Comment · Article · Jan 7, 2021 · [How I learned Redux - An ultimate guide series for a beginner](https://hashnode.com/posts/how-i-learned-redux/5ff7294baa5c467fe15565b4)

[FWIW, this process can be simplified greatly, on several levels. First, we already have a Redux+TS template for Create-React-App: https://github.com/reduxjs/cra-template-redux-typescript . It comes with Redux Toolkit and React-Redux already configured. Second, the examples here are actually going against how we recommend writing Redux code. Redux Toolkit is installed, but it's not being used at all to write the reducers You should be using the createSlice API, which will also auto-generate the action creators for you createSlice uses Immer inside, so you can "mutate" the state inside of the reducer instead of having to write spread operations for immutable updates The logic should be organized into single-file "slice" files per feature - no need for separate "actions" and "action-creators" files. Please see these resources for our guidelines on how to write Redux code correctly: https://redux.js.org/tutorials/fundamentals/part-8-modern-redux https://redux.js.org/style-guide/style-guide https://redux-toolkit.js.org/usage/usage-with-typescript](https://hashnode.com/posts/getting-started-with-react-typescript-and-redux/5fc3c7044b7d527151c3856c/comment/5fc3d68b4b7d527151c386b3)

Comment · Article · Nov 29, 2020 · [Getting Started with React, TypeScript and Redux.](https://hashnode.com/posts/getting-started-with-react-typescript-and-redux/5fc3c7044b7d527151c3856c)

[Hi, I'm a Redux maintainer. You can simplify this code considerably by using our official Redux Toolkit package. It includes utilities to simplify several common Redux use cases, including store setup, defining reducers, immutable update logic, and even creating entire "slices" of state at once. It also has a createAsyncThunk API that automatically dispatches pending/fulfilled/rejected actions based on a promise, and createSlice now offers "matcher" reducers that match against arbitrary actions (such as "any action whose type ends with /pending"). We specifically recommend using RTK as the default way to write Redux logic, and I just published a brand-new "Redux Essentials" core docs tutorial, which teaches beginners "how to use Redux, the right way", using our latest recommended tools and practices. I'd encourage you to check it out: https://redux.js.org/tutorials/essentials/part-1-overview-concepts](https://hashnode.com/posts/an-easier-way-to-handle-loading-error-and-success-states-in-redux/5f25550090ac4260edf34efb/comment/5f25a040669da9610ee17e17)

Comment · Article · Aug 1, 2020 · [An easier way to handle LOADING, ERROR and SUCCESS states in Redux](https://hashnode.com/posts/an-easier-way-to-handle-loading-error-and-success-states-in-redux/5f25550090ac4260edf34efb)

[I personally draw the line at running npm init, but I'm kinda biased :) More seriously, while you certainly can write a React app with only component state, and there's nothing wrong with doing so, using Redux (or even another state management library like MobX) can have a number of benefits. I wrote a Stack Overflow answer on "Redux vs plain React?" a couple months ago, which I'll paste here for reference: Off the top of my head, a few advantages: A lot of the time your app's state tree could be considerably different than the UI tree Many components may need to access the same state and display it in different ways Hot reloading components will wipe out your existing component tree, including any state stored inside of them. Keeping the state separate from the UI tree allows the UI tree to be swapped out and reloaded with the updated components, while keeping your current development state the same. And that's before getting to many of the commonly discussed benefits, such as predictable state updates, time travel debugging, improved testability, and centralized logic. It's certainly true that you can write an entire application using nothing but React's component state (and Dan Abramov himself says that people often jump into Redux too early), but from my perspective Redux is absolutely worth it. You may also want to read the Redux FAQ entry on When should I use Redux?.](https://hashnode.com/forums/thread/when-should-you-actually-use-redux-given-you-can-manage-all-your-state-in-a-top-level-component-where-do-you-draw-the-line/comment/5831da89d2221d852de98c92)

Comment · Thread · Nov 20, 2016 · 11 · [When should you actually use Redux; given you can manage all your state in a top level component? Where do you draw the line?](https://hashnode.com/forums/thread/when-should-you-actually-use-redux-given-you-can-manage-all-your-state-in-a-top-level-component-where-do-you-draw-the-line)

[Controlled components are primarily related to forms, since input elements normally store their own value internally and allow you to ask for that value later. By always forcing the input to have a value you specify, and handling the change events yourself with updates to your state, dealing with inputs becomes more predictable. As for Redux, it's entirely fine to use component-level state wherever you feel it's necessary. For example, having an input that's connected to Redux and dispatching an action on every keystroke may be overkill, so tracking the input's value in component state and only dispatching the action on form submission may simplify things. FYI, I keep a big list of links to high-quality articles on React, Redux, and related topics, at https://github.com/markerikson/react-redux-links . As part of that list, I have a page of articles talking about React and Forms that you may find useful, including a number of articles on controlled inputs. You may also want to refer to the Redux FAQ question on Redux state vs React component state.](https://hashnode.com/forums/thread/can-you-explain-the-distinction-the-pros-and-cons-in-a-simple-to-understand-way-for-controlled-components-vs-uncontrolled-components/comment/5829ddc551e4eadf5f52617b)

Comment · Thread · Nov 14, 2016 · 2 · [Can you explain the distinction, the pros and cons; in a simple to understand way, for Controlled Components vs. Uncontrolled Components?](https://hashnode.com/forums/thread/can-you-explain-the-distinction-the-pros-and-cons-in-a-simple-to-understand-way-for-controlled-components-vs-uncontrolled-components)

[FYI, connect supports a shorthand syntax for method binding. Just pass an object full of action creators instead of a mapDispatch function, and you will get those action creators bound up, as props. For example: const actions = {onDeleteFlashMessage : deleteFlashMessage}); export default connect(null, actions)(MyComponent); Overall, I prefer to define separate action creators outside of mapDispatch, and bind them using the shorthand syntax. That also makes the functions more reusable and testable. I talk about this a bit in my blog post on Idiomatic Redux: Why Use Action Creators?.](https://hashnode.com/forums/thread/which-method-are-you-using-for-map-redux-dispatches-to-props/comment/58280f9451e4eadf5f52296b)

Comment · Thread · Nov 13, 2016 · 3 · [Which method are you using for map Redux dispatches to props?](https://hashnode.com/forums/thread/which-method-are-you-using-for-map-redux-dispatches-to-props)

[I've written some suggestions for dealing with normalized data in a Redux app, and also collected links to other resources: I wrote the Structuring Reducers section for the Redux docs, which includes links to some articles on normalization, and how-to guidance on Normalizing State Shape and Updating Normalized Data I also just wrote a pair of articles on using Redux-ORM to help manage normalized data in your Redux store: Practical Redux, Part 1: Redux-ORM Basics and Practical Redux, Part 2: Redux-ORM Concepts and Techniques I also have links to some other articles on normalization as part of my React/Redux links list: Redux Techniques#Normalization](https://hashnode.com/forums/thread/what-are-the-best-practices-when-normalizing-redux-data/comment/58262383d47041a819fd084a)

Comment · Thread · Nov 11, 2016 · 11 · [What are the best practices when normalizing Redux data?](https://hashnode.com/forums/thread/what-are-the-best-practices-when-normalizing-redux-data)

[I keep a big list of links to high-quality React-related tutorials and articles over at https://github.com/markerikson/react-redux-links . Specifically intended to be a great starting point for anyone trying to learn the ecosystem. I've got a wide variety of tutorials linked, and also have numerous intermediate and advanced articles on a variety of topics.](https://hashnode.com/forums/thread/anyone-knows-any-good-resources-to-master-react/comment/577b08e657675ec2fcfd0c37)

Comment · Thread · Jul 5, 2016 · 1 · [Anyone knows any good resources to master React?](https://hashnode.com/forums/thread/anyone-knows-any-good-resources-to-master-react)
