New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/react-compose

Package Overview
Dependencies
Maintainers
13
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/react-compose - npm Package Compare versions

Comparing version 0.1.12 to 1.0.0

6

CHANGELOG.md

@@ -11,4 +11,10 @@ # Changelog

## 1.0.0 - 2019-04-23
### Fixed
- The type signature of the component returned by `compose` now correctly strips the composed props in TypeScript 3.2+ ([#602](https://github.com/Shopify/quilt/pull/602))
## 0.1.10 - 2019-01-09
- Start of Changelog

2

dist/index.d.ts

@@ -5,2 +5,2 @@ import * as React from 'react';

export declare type WrappingFunction = (Component: ReactComponent<any>) => ReactComponent<any>;
export default function compose<Props>(...wrappingFunctions: WrappingFunction[]): <ComposedProps, C>(OriginalComponent: (React.ComponentClass<ComposedProps, any> & C) | (React.FunctionComponent<ComposedProps> & C)) => (React.ComponentClass<Props, any> & C) | (React.FunctionComponent<Props> & C);
export default function compose<Props>(...wrappingFunctions: WrappingFunction[]): <ComposedProps, C>(OriginalComponent: (React.ComponentClass<ComposedProps, any> & C) | (React.FunctionComponent<ComposedProps> & C)) => (React.ComponentClass<Props, any> & Pick<(React.ComponentClass<ComposedProps, any> & C) | (React.FunctionComponent<ComposedProps> & C), "defaultProps" | Exclude<keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"propTypes" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"contextType" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"contextTypes" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"childContextTypes" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"defaultProps" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"displayName" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"getDerivedStateFromProps" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"getDerivedStateFromError" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<keyof C & "propTypes", "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<keyof C & "contextTypes", "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<keyof C & "defaultProps", "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<keyof C & "displayName", "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors">>) | (React.FunctionComponent<Props> & Pick<(React.ComponentClass<ComposedProps, any> & C) | (React.FunctionComponent<ComposedProps> & C), "defaultProps" | Exclude<keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"propTypes" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"contextType" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"contextTypes" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"childContextTypes" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"defaultProps" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"displayName" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"getDerivedStateFromProps" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<"getDerivedStateFromError" & keyof C, "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<keyof C & "propTypes", "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<keyof C & "contextTypes", "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<keyof C & "defaultProps", "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors"> | Exclude<keyof C & "displayName", "propTypes" | "contextType" | "contextTypes" | "childContextTypes" | "displayName" | "getDerivedStateFromProps" | "getDefaultProps" | "getDerivedStateFromErrors">>);
{
"name": "@shopify/react-compose",
"version": "0.1.12",
"version": "1.0.0",
"license": "MIT",

@@ -26,2 +26,3 @@ "description": "Cleanly compose multiple component enhancers together with minimal fuss",

"dependencies": {
"@shopify/useful-types": "^1.2.4",
"hoist-non-react-statics": "^3.0.1",

@@ -35,5 +36,5 @@ "tslib": "^1.9.3"

"@types/enzyme": "^3.1.10",
"typescript": "~3.1.6"
"typescript": "~3.2.1"
},
"sideEffects": false
}
import * as React from 'react';
import hoistStatics from 'hoist-non-react-statics';
import {NonReactStatics} from '@shopify/useful-types';

@@ -16,3 +17,3 @@ export type ReactComponent<P> = React.ComponentType<P>;

OriginalComponent: ReactComponent<ComposedProps> & C,
): ReactComponent<Props> & C {
): ReactComponent<Props> & NonReactStatics<typeof OriginalComponent> {
const result: ReactComponent<ComposedProps> = wrappingFunctions.reduceRight(

@@ -27,4 +28,4 @@ (component: ReactComponent<any>, wrappingFunction: WrappingFunction) =>

OriginalComponent as ComponentClass,
) as ReactComponent<Props> & C;
) as ReactComponent<Props> & NonReactStatics<typeof OriginalComponent>;
};
}

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