2022-02-02
1459
#react#redux#typescript
Samson Omojola
90800
Feb 2, 2022 â‹… 5 min read

React 18, React Redux 8, and TypeScript: What you need to know

Samson Omojola I'm an experienced software engineer. I love creating applications with responsive, beautiful, intuitive, state-of-the-art designs. I'm skilled in HTML, CSS, JavaScript, Ionic, React, PHP, Laravel, and Flutter.

Recent posts:

Comparing Mutative Vs Immer Vs Reducers For Data Handling In React

Comparing React state tools: Mutative vs. Immer vs. reducers

Mutative processes data with better performance than both Immer and native reducers. Let’s compare these data handling options in React.

Rashedul Alam
Apr 26, 2024 â‹… 7 min read
Radix Ui Adoption Guide Overview Examples And Alternatives

Radix UI adoption guide: Overview, examples, and alternatives

Radix UI is quickly rising in popularity and has become an excellent go-to solution for building modern design systems and websites.

Nefe Emadamerho-Atori
Apr 25, 2024 â‹… 11 min read
Understanding The Css Revert Layer Keyword, Part Of Css Cascade Layers

Understanding the CSS revert-layer keyword

In this article, we’ll explore CSS cascade layers — and, specifically, the revert-layer keyword — to help you refine your styling strategy.

Chimezie Innocent
Apr 24, 2024 â‹… 6 min read
Exploring Nushell, A Rust Powered, Cross Platform Shell

Exploring Nushell, a Rust-powered, cross-platform shell

Nushell is a modern, performant, extensible shell built with Rust. Explore its pros, cons, and how to install and get started with it.

Oduah Chigozie
Apr 23, 2024 â‹… 6 min read
View all posts

4 Replies to "React 18, React Redux 8, and TypeScript: What you need to know"

  1. Nice summary! One nitpick: It’s not “Redux 8”, it’s “React-Redux 8”. The `redux` core library is still at version 4.1.x and is unrelated to these changes. (If you could update the title and descriptions to say “React-Redux” I’d appreciate it!)

  2. Thank you for the great post. I have a few suggestions.

    1. I think Redux 8 is a bit misleading because the latest version of Redux is 4 and 8 is the version of React Redux.

    2. Updates in `handleClidk` funciton of “Automatic render batching” have been batched before 18. React has processed updates in event handlers as batched before 18. React 18 is going to apply batching more places other than event handlers and lifecycle methods.

    Thank you!

    1. Hi Koba04, glad you loved the post! I believe this part of the article covered your second point:

      “With previous versions of React, this only happened when the trigger is a normal function.

      If the multiple state updates are triggered by a promise or a callback, their responses are not rendered at the same time. In React 18, all renders are batched, meaning they’ll occur at the same time, regardless of their trigger.”

      So multiple state updates in a regular event handler function are batched in React 17. But if the state updates are in a promise, they don’t get batched.

      However, in React 18, all state updates – whether in an event handler function or a promise – get batched automatically.

      Perhaps, I could have worded it better.

      Thanks for the feedback!

  3. Did you face any error like below when you tried to upgrade to react-redux-8 ? This error is coming when I try to load my application. I am using React @18, latest typescript and react-redux@8. This issue is not observed when I use React @18, latest typescript and react-redux@7.

    Uncaught TypeError: Cannot read properties of undefined (reading ‘call’)
    at __webpack_require__ (bundle-285f38a0450f604bbf91.js:1:7899911)
    at l (bundle-285f38a0450f604bbf91.js:1:7904162)
    at eval (6172:22:22)
    at 6172 (bundle-285f38a0450f604bbf91.js:1:6911952)
    at __webpack_require__ (bundle-285f38a0450f604bbf91.js:1:7899911)
    at l (bundle-285f38a0450f604bbf91.js:1:7904162)
    at eval (5656:144:34)
    at 5656 (bundle-285f38a0450f604bbf91.js:1:6941346)
    at __webpack_require__ (bundle-285f38a0450f604bbf91.js:1:7899911)
    at l (bundle-285f38a0450f604bbf91.js:1:7904162)
    __webpack_require__ @ bundle-285f38a0450f604bbf91.js:1
    l @ bundle-285f38a0450f604bbf91.js:1
    eval @ 6172:22
    6172 @ bundle-285f38a0450f604bbf91.js:1
    __webpack_require__ @ bundle-285f38a0450f604bbf91.js:1
    l @ bundle-285f38a0450f604bbf91.js:1
    eval @ 5656:144
    5656 @ bundle-285f38a0450f604bbf91.js:1
    __webpack_require__ @ bundle-285f38a0450f604bbf91.js:1
    l @ bundle-285f38a0450f604bbf91.js:1
    eval @ 7866:12
    7866 @ bundle-285f38a0450f604bbf91.js:1
    __webpack_require__ @ bundle-285f38a0450f604bbf91.js:1
    (anonymous) @ bundle-285f38a0450f604bbf91.js:1
    (anonymous) @ bundle-285f38a0450f604bbf91.js:1
    client.js:96

Leave a Reply