Socket
Socket
Sign inDemoInstall

styled-components

Package Overview
Dependencies
Maintainers
2
Versions
358
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

styled-components - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2-0

2

CHANGELOG.md

@@ -13,2 +13,4 @@ # Change Log

- Modify `StyleNativeComponent.js` so that `generateAndInjectStyles` is called outside of `render`, thanks to [@sheepsteak](https://github.com/sheepsteak). (see [#171](https://github.com/styled-components/styled-components/pull/171))
## [v1.1.1]

@@ -15,0 +17,0 @@

8

lib/models/StyledComponent.js

@@ -106,6 +106,6 @@ 'use strict';

var _props = this.props,
className = _props.className,
children = _props.children,
innerRef = _props.innerRef;
var _props = this.props;
var className = _props.className;
var children = _props.children;
var innerRef = _props.innerRef;
var generatedClassName = this.state.generatedClassName;

@@ -112,0 +112,0 @@

@@ -73,7 +73,17 @@ 'use strict';

// This will be called once immediately
_this2.setState({ theme: theme });
var generatedStyles = _this2.generateAndInjectStyles(theme, _this2.props);
_this2.setState({ generatedStyles: generatedStyles, theme: theme });
});
} else {
var generatedStyles = this.generateAndInjectStyles(this.props.theme || {}, this.props);
this.setState({ generatedStyles: generatedStyles });
}
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var generatedStyles = this.generateAndInjectStyles(this.state.theme || this.props.theme, nextProps);
this.setState({ generatedStyles: generatedStyles });
}
}, {
key: 'componentWillUnmount',

@@ -96,11 +106,9 @@ value: function componentWillUnmount() {

value: function render() {
var _props = this.props,
style = _props.style,
children = _props.children,
innerRef = _props.innerRef;
var _props = this.props;
var style = _props.style;
var children = _props.children;
var innerRef = _props.innerRef;
var generatedStyles = this.state.generatedStyles;
var theme = this.state.theme || this.props.theme || {};
var generatedStyles = this.generateAndInjectStyles(theme, this.props);
var propsForElement = _extends({}, this.props);

@@ -107,0 +115,0 @@ propsForElement.style = [generatedStyles, style];

@@ -75,8 +75,9 @@ 'use strict';

function StyleSheet() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
_ref$speedy = _ref.speedy,
speedy = _ref$speedy === undefined ? !isDev && !isTest : _ref$speedy,
_ref$maxLength = _ref.maxLength,
maxLength = _ref$maxLength === undefined ? isBrowser && oldIE ? 4000 : 65000 : _ref$maxLength;
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var _ref$speedy = _ref.speedy;
var speedy = _ref$speedy === undefined ? !isDev && !isTest : _ref$speedy;
var _ref$maxLength = _ref.maxLength;
var maxLength = _ref$maxLength === undefined ? isBrowser && oldIE ? 4000 : 65000 : _ref$maxLength;
_classCallCheck(this, StyleSheet);

@@ -83,0 +84,0 @@

{
"name": "styled-components",
"version": "1.1.1",
"version": "1.1.2-0",
"description": "Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅",

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

@@ -10,3 +10,4 @@ // @flow

theme: any,
generatedClassName?: string
generatedClassName?: string,
generatedStyles?: any
}

@@ -13,0 +14,0 @@ unsubscribe: () => void

@@ -41,7 +41,22 @@ // @flow

// This will be called once immediately
this.setState({ theme })
const generatedStyles = this.generateAndInjectStyles(theme, this.props)
this.setState({ generatedStyles, theme })
})
} else {
const generatedStyles = this.generateAndInjectStyles(
this.props.theme || {},
this.props
)
this.setState({ generatedStyles })
}
}
componentWillReceiveProps(nextProps: any) {
const generatedStyles = this.generateAndInjectStyles(
this.state.theme || this.props.theme,
nextProps
)
this.setState({ generatedStyles })
}
componentWillUnmount() {

@@ -60,6 +75,4 @@ if (this.unsubscribe) {

const { style, children, innerRef } = this.props
const theme = this.state.theme || this.props.theme || {}
const { generatedStyles } = this.state
const generatedStyles = this.generateAndInjectStyles(theme, this.props)
const propsForElement = { ...this.props }

@@ -66,0 +79,0 @@ propsForElement.style = [generatedStyles, style]

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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