Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-shadow-root

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-shadow-root - npm Package Compare versions

Comparing version 4.0.1 to 4.1.0

lib/ReactShadowRoot.js

6

lib/index.js

@@ -14,3 +14,3 @@ "use strict";

var _ShadowRoot = _interopRequireDefault(require("./ShadowRoot.js"));
var _ReactShadowRoot = _interopRequireDefault(require("./ReactShadowRoot.js"));

@@ -21,4 +21,4 @@ var _StyleSlot = _interopRequireDefault(require("./StyleSlot.js"));

_ShadowRoot["default"].StyleSlot = _StyleSlot["default"];
var _default = _ShadowRoot["default"];
_ReactShadowRoot["default"].StyleSlot = _StyleSlot["default"];
var _default = _ReactShadowRoot["default"];
exports["default"] = _default;
{
"name": "react-shadow-root",
"version": "4.0.1",
"version": "4.1.0",
"description": "Adds a shadow root to React components",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -10,7 +10,7 @@ # react-shadow-root

## ShadowRoot
## ReactShadowRoot
### Usage
```jsx
import React form 'react';
import ShadowRoot from 'react-shadow-root';
import ReactShadowRoot from 'react-shadow-root';

@@ -48,6 +48,6 @@ class ShadowCounter extends React.Component {

<div> {/* The shadow root will be attached to this DIV */}
<ShadowRoot>
<ReactShadowRoot>
<style>{style}</style>
<span>{this.state.cnt}</span> <button onClick={this.increment}>Click Me</button>
</ShadowRoot>
</ReactShadowRoot>
</div>

@@ -58,3 +58,3 @@ );

```
When the shadow root is created on its parent element, all children are copied into the shadow DOM. Styles in the shadow DOM are automatically scoped. You can inspect the element to confirm. [Slots](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) work as expected; just be sure to add `{this.props.children}` _after_ the closing `ShadowRoot` tag.
When the shadow root is created on its parent element, all children are copied into the shadow DOM. Styles in the shadow DOM are automatically scoped. You can inspect the element to confirm. [Slots](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/slot) work as expected; just be sure to add `{this.props.children}` _after_ the closing `ReactShadowRoot` tag.

@@ -72,4 +72,4 @@ ### Static Properties

| `delegatesFocus` | `Boolean` | `true` or `false` | `false` | Expands the focus behavior of elements within the shadow DOM. Click [here](https://apearce.github.io/react-shadow-root/#delegates-focus) for more information. |
| `mode` | `String` | `open` or `closed` | `open` | Sets the mode of the shadow root. |
| `stylesheets` | `Array` | `arrayOf(CSSStyleSheet)` | optional | Takes an array of CSSStyleSheet objects for constructable stylesheets. |
| `mode` | `String` | `open` or `closed` | `open` | Sets the [mode](https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/mode) of the shadow root. |
| `stylesheets` | `Array` | `arrayOf(CSSStyleSheet)` | optional | Takes an array of [CSSStyleSheet](https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleSheet) objects for constructable stylesheets. |

@@ -76,0 +76,0 @@ ## StyleSlot (deprecated)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc