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:

Creating toast notifications using Solid Toast

Toast notifications are messages that appear on the screen to provide feedback to users. When users interact with the user […]

Chimezie Innocent
Sep 6, 2024 â‹… 7 min read
Deno Adoption Guide: Overview, Examples, And Alternatives

Deno adoption guide: Overview, examples, and alternatives

Deno’s features and built-in TypeScript support make it appealing for developers seeking a secure and streamlined development experience.

Emmanuel Odioko
Sep 5, 2024 â‹… 10 min read
Types vs. Interfaces in TypeScript

Types vs. interfaces in TypeScript

It can be difficult to choose between types and interfaces in TypeScript, but in this post, you’ll learn which to use in specific use cases.

Yan Sun
Sep 5, 2024 â‹… 9 min read
Flutter Logo

How to build a bottom navigation bar in Flutter

This tutorial demonstrates how to build, integrate, and customize a bottom navigation bar in a Flutter app.

Pinkesh Darji
Sep 5, 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