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:

react native's new architecture: sync and async rendering

React Native’s New Architecture: Sync and async rendering

React Native’s New Architecture offers significant performance advantages. In this article, you’ll explore synchronous and asynchronous rendering in React Native through practical use cases.

Emmanuel John
Dec 24, 2024 â‹… 8 min read
Building a Full-Featured Laravel Admin Dashboard with Filament

Building a full-featured Laravel admin dashboard with Filament

Build scalable admin dashboards with Filament and Laravel using Form Builder, Notifications, and Actions for clean, interactive panels.

Kayode Adeniyi
Dec 20, 2024 â‹… 5 min read
Working With URLs In JavaScript

Working with URLs in JavaScript

Break down the parts of a URL and explore APIs for working with them in JavaScript, parsing them, building query strings, checking their validity, etc.

Joe Attardi
Dec 19, 2024 â‹… 6 min read
Lazy Loading Vs. Eager Loading

Lazy loading vs. Eager loading

In this guide, explore lazy loading and error loading as two techniques for fetching data in React apps.

Njong Emy
Dec 18, 2024 â‹… 5 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