react-shadow-root
Advanced tools
Comparing version 4.0.1 to 4.1.0
@@ -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) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22968