aesthetic-react
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -0,1 +1,8 @@ | ||
### 1.1.1 - 2019-07-24 | ||
#### 🐞 Fixes | ||
- **[TS]** Updated `StyledComponent` to extend from `React.memo`s `NamedExoticComponent` instead of | ||
`FunctionComponent`. | ||
## 1.1.0 - 2019-07-12 | ||
@@ -2,0 +9,0 @@ |
@@ -61,7 +61,3 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
WithStyles.extendStyles = function extendStyles(customStyleSheet, extendOptions) { | ||
if (extendOptions === void 0) { | ||
extendOptions = {}; | ||
} | ||
WithStyles.extendStyles = function (customStyleSheet, extendOptions) { | ||
if ("production" !== process.env.NODE_ENV) { | ||
@@ -68,0 +64,0 @@ if (!extendable) { |
@@ -66,8 +66,8 @@ import React from 'react'; | ||
} | ||
export interface StyledComponentClass<Theme, Props> extends React.FunctionComponent<Props> { | ||
export interface StyledComponent<Theme, Props> extends React.NamedExoticComponent<Props> { | ||
displayName: string; | ||
styleName: StyleName; | ||
WrappedComponent: React.ComponentType<Props & WithStylesWrappedProps<Theme, any, any>>; | ||
extendStyles<T>(styleSheet: StyleSheetDefinition<Theme, T>, extendOptions?: Omit<WithStylesOptions, 'extendFrom'>): StyledComponentClass<Theme, Props>; | ||
WrappedComponent: React.ComponentType<any>; | ||
extendStyles<T>(styleSheet: StyleSheetDefinition<Theme, T>, extendOptions?: Omit<WithStylesOptions, 'extendFrom'>): StyledComponent<Theme, Props>; | ||
} | ||
//# sourceMappingURL=types.d.ts.map |
import React from 'react'; | ||
import Aesthetic, { StyleSheetDefinition } from 'aesthetic'; | ||
import { WithStylesOptions, WithStylesWrappedProps, WithStylesWrapperProps, StyledComponentClass } from './types'; | ||
import { WithStylesOptions, WithStylesWrappedProps, WithStylesWrapperProps, StyledComponent } from './types'; | ||
/** | ||
* Wrap a React component with an HOC that injects the defined style sheet as a prop. | ||
*/ | ||
export default function withStylesFactory<Theme extends object, NativeBlock extends object, ParsedBlock extends object | string = NativeBlock>(aesthetic: Aesthetic<Theme, NativeBlock, ParsedBlock>): <T>(styleSheet: StyleSheetDefinition<Theme, T>, options?: WithStylesOptions) => <Props extends object = {}>(WrappedComponent: React.ComponentType<Props & WithStylesWrappedProps<Theme, NativeBlock, ParsedBlock>>) => StyledComponentClass<Theme, Props & WithStylesWrapperProps>; | ||
export default function withStylesFactory<Theme extends object, NativeBlock extends object, ParsedBlock extends object | string = NativeBlock>(aesthetic: Aesthetic<Theme, NativeBlock, ParsedBlock>): <T>(styleSheet: StyleSheetDefinition<Theme, T>, options?: WithStylesOptions) => <Props extends object = {}>(WrappedComponent: React.ComponentType<Props & WithStylesWrappedProps<Theme, NativeBlock, ParsedBlock>>) => StyledComponent<Theme, Props & WithStylesWrapperProps>; | ||
//# sourceMappingURL=withStylesFactory.d.ts.map |
@@ -77,7 +77,3 @@ "use strict"; | ||
WithStyles.extendStyles = function extendStyles(customStyleSheet, extendOptions) { | ||
if (extendOptions === void 0) { | ||
extendOptions = {}; | ||
} | ||
WithStyles.extendStyles = function (customStyleSheet, extendOptions) { | ||
if ("production" !== process.env.NODE_ENV) { | ||
@@ -84,0 +80,0 @@ if (!extendable) { |
{ | ||
"name": "aesthetic-react", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "React hooks, composers, and more for styling components with Aesthetic.", | ||
@@ -42,3 +42,3 @@ "keywords": [ | ||
}, | ||
"gitHead": "a80755f38fd8277b613261ab38ce2387555f3dbf" | ||
"gitHead": "d2fac6b3854e7c12e60c0fca8e33e35027f395d2" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
44155
631