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

react-shadow

Package Overview
Dependencies
Maintainers
1
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-shadow - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

example/js/app.js

@@ -108,3 +108,3 @@ import React, { Component, PropTypes } from 'react';

className={name === country ? 'active' : ''}
>
>
{name}

@@ -111,0 +111,0 @@ </a>

{
"name": "react-shadow",
"version": "1.0.0",
"description": "Use Shadow DOM with React.js and CSS imports; write your component styles in CSS!",
"version": "1.0.1",
"description": "Utilise Shadow DOM in React with all the benefits of style encapsulation.",
"main": "dist/react-shadow.js",

@@ -98,2 +98,2 @@ "scripts": {

}
}
}

@@ -21,5 +21,7 @@ ![Screenshot](media/screenshot.png)

export default props => {
<ShadowDOM cssDocuments={['css/core/calendar.css', props.theme]}>
<h1>Calendar</h1>
</ShadowDOM>
return (
<ShadowDOM cssDocuments={['css/core/calendar.css', props.theme]}>
<h1>Calendar</h1>
</ShadowDOM>
);
}

@@ -32,6 +34,6 @@ ```

As the CSS documents are being fetched over the network the host element will have a `className` of `resolving` for you to avoid the dreaded [FOIC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content). Once **all** of the documents have been attached the `className` will change to `resolved`.
As the CSS documents are being fetched over the network, the host element will have a `className` of `resolving` for you to avoid the dreaded [FOIC](https://en.wikipedia.org/wiki/Flash_of_unstyled_content). Once **all** of the documents have been attached the `className` will change to `resolved`.
### Cached Documents
Where components share CSS documents, only one instance of the CSS document will be fetched due to [`memoize` of the `fetchStylesheets`](https://github.com/Wildhoney/ReactShadow/blob/react-15.0/src/react-shadow.js#L22) function.
Where components share CSS documents, only one instance of the CSS document will be fetched due to `memoize` of the [`fetchStylesheet`](https://github.com/Wildhoney/ReactShadow/blob/react-15.0/src/react-shadow.js#L22) function.

@@ -40,2 +40,10 @@ import { get as fetch } from 'axios';

/**
* @constant defaultProps
* @type {Object}
*/
static defaultProps = {
cssDocuments: []
};
/**
* @constructor

@@ -70,3 +78,3 @@ */

const root = node.attachShadow ? node.attachShadow({ mode: 'open' }) : node.createShadowRoot();
const cssDocuments = this.props.cssDocuments || [];
const cssDocuments = this.props.cssDocuments;
const container = this.getContainer();

@@ -77,3 +85,3 @@

render(container, root);
!cssDocuments && this.setState({ root });
cssDocuments.length === 0 && this.setState({ root });

@@ -80,0 +88,0 @@ if (cssDocuments.length) {

Sorry, the diff of this file is too big to display

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