---
title: "Discussion on \"Introduction to Web Workers in React: A Beginner's Guide\" | Hashnode"
description: "Discussion on \"Introduction to Web Workers in React: A Beginner's Guide\". webworkers,web workers,webworker,web workers javascript,javascript worker,angular web worker,website worker,react web worker,js worker,pwa with angular,pwa"
url: "https://hashnode.com/posts/introduction-to-web-workers-in-react-2023/63a727144b07d30f282cfc15"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Introduction to Web Workers in React: A Beginner's Guide](https://djaytechdiary.com/introduction-to-web-workers-in-react-2023?utm_source=hashnode&utm_medium=feed)

webworkers,web workers,webworker,web workers javascript,javascript worker,angular web worker,website worker,react web worker,js worker,pwa with angular,pwa

Dec 24, 2022 · 6 min read · djaytechdiary.com  
Updated Jan 23, 2023  
Read the article

-   [#webworker](https://hashnode.com/tag/webworker)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#nodejs](https://hashnode.com/tag/nodejs)
-   [#web-development](https://hashnode.com/tag/web-development)

## Written by

[Jay Desai](https://hashnode.com/@desaijay)

@desaijay · Mumbai

  
[View profile](https://hashnode.com/@desaijay)

Be useful rather than just purposeful

Hey there! I'm Jay. 👨🏻‍💻 About Me 🤔 Exploring new technologies and developing software solutions and quick hacks. 🎓 Bachelors of Engineering from Mumbai University. 🌱 Learning more about Cloud Architecture, Systems Design and Artificial Intelligence. ✍️ Pursuing Blog Writing as hobbies/side hustles. 🛠 Tech Stack 🌐 JavaScript | Bootstrap | Node.js | ReactJS 💻 DevOps | Cloud | CI/CD | AWS | AZURE 🛢 MySQL | MongoDB | PostgreSQL 🔧 Git | Markdown

## Responses 1

Markdown supported · ⌘↵ to post

[Jeff Tillwick](https://hashnode.com/@somewhatlazy)

[Jun 1, 2023](https://hashnode.com/posts/introduction-to-web-workers-in-react-2023/63a727144b07d30f282cfc15/comment/64792cfb68c73be8bfc3feb6)

I'd like to know why the shared worker uses .port and the external worker does not. What is the logic there?

[Jay Desai](https://hashnode.com/@desaijay)

[Dec 1, 2024](https://hashnode.com/posts/introduction-to-web-workers-in-react-2023/63a727144b07d30f282cfc15/comment/64792cfb68c73be8bfc3feb6#reply-674bfaf446e962fbd0a04ed6)

Shared workers use .port because they support multiple clients (scripts or tabs) and each connection requires a unique MessagePort for bidirectional communication. The MessagePort allows the worker to distinguish messages from different clients. Dedicated workers, on the other hand, are tied to a single client, so they don't need .port. Communication with a dedicated worker happens directly through the Worker instance.
