---
title: "Discussion on \"attachShadow() method in react-scan source code.\" | Hashnode"
description: "Discussion on \"attachShadow() method in react-scan source code.\". In this article, we will review the below code snippet from react-scan source code.\nconst initRootContainer = (): RootContainer => {\n  if (rootContainer && shadowRoot) {\n    return { rootContainer, shadowRoot };\n  }\n\n  rootContainer = document.create..."
url: "https://hashnode.com/posts/attachshadow-method-in-react-scan-source-code/67ce84552bebdafd2e88bfdd"
---

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

Discussion

# [attachShadow() method in react-scan source code.](https://thinkthroo.com/blog/attachshadow-method-in-react-scan-source-code?utm_source=hashnode&utm_medium=feed)

In this article, we will review the below code snippet from react-scan source code. const initRootContainer = (): RootContainer => { if (rootContainer && shadowRoot) { return { rootContainer, shadowRoot }; } rootContainer = document.create...

Mar 10, 2025 · 2 min read · thinkthroo.com  
Updated Apr 23, 2025  
Read the article

-   [#opensource](https://hashnode.com/tag/opensource)
-   [#javascript](https://hashnode.com/tag/javascript)
-   [#shadowdom](https://hashnode.com/tag/shadowdom)
-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#reactscan](https://hashnode.com/tag/reactscan)

## Written by

[Ramu Narasinga](https://hashnode.com/@ramunarasinga)

@ramunarasinga · India

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

I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
