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:

Implementing Infinite Scroll In Next Js With Server Actions

Implementing infinite scroll in Next.js with Server Actions

Infinite scrolling in Next.js no longer requires external libraries — Server Actions let us fetch initial data directly on the server.

Rahul Chhodde
Apr 19, 2024 â‹… 10 min read
Integrating Django Templates With React For Dynamic Webpages

Integrating Django templates with React for dynamic webpages

Create a dynamic demo blog site using Django and React to demonstrate Django’s server-side functionalities and React’s interactive UI.

Kayode Adeniyi
Apr 18, 2024 â‹… 7 min read
Using Aoi Js To Build A Bot For Discord

Using aoi.js to build a bot on Discord

Explore how the aoi.js library makes it easy to create Discord bots with useful functionalities for frontend applications.

Rahul Padalkar
Apr 17, 2024 â‹… 9 min read
Web Components Adoption Guide: Overview, Examples, And Alternatives

Web Components adoption guide: Overview, examples, and alternatives

Evaluate Web Components, a set of standards that allow you to create custom HTML tags for more reusable, manageable code.

Elijah Asaolu
Apr 16, 2024 â‹… 11 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