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:

TypeScript logo over a pink and white background.

Drizzle vs. Prisma: Which ORM is best for your project?

Compare Prisma and Drizzle ORMs to learn their differences, strengths, and weaknesses for data access and migrations.

Temitope Oyedele
Nov 21, 2024 â‹… 10 min read
Practical Implementation Of The Rule Of Least Power For Developers

Practical implementation of the Rule of Least Power for developers

It’s easy for devs to default to JavaScript to fix every problem. Let’s use the RoLP to find simpler alternatives with HTML and CSS.

Timonwa Akintokun
Nov 21, 2024 â‹… 8 min read
Rust logo over black marble background.

Handling memory leaks in Rust

Learn how to manage memory leaks in Rust, avoid unsafe behavior, and use tools like weak references to ensure efficient programs.

Ukeje Goodness
Nov 20, 2024 â‹… 4 min read
Robot pretending to be a person.

Using curl-impersonate in Node.js to avoid blocks

Bypass anti-bot measures in Node.js with curl-impersonate. Learn how it mimics browsers to overcome bot detection for web scraping.

Antonello Zanini
Nov 20, 2024 â‹… 13 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