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

@reactioncommerce/components-context

Package Overview
Dependencies
Maintainers
5
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reactioncommerce/components-context - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

25

dist/main.js

@@ -13,2 +13,6 @@ "use strict";

var _hoistNonReactStatics = require("hoist-non-react-statics");
var _hoistNonReactStatics2 = _interopRequireDefault(_hoistNonReactStatics);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -18,2 +22,13 @@

/**
* @see https://reactjs.org/docs/higher-order-components.html#convention-wrap-the-display-name-for-easy-debugging
* @param {Object} HOC The higher-order component
* @param {Object} WrappedComponent The wrapped component
* @returns {undefined}
*/
function wrapDisplayName(HOC, WrappedComponent) {
var innerDisplayName = WrappedComponent.displayName || WrappedComponent.name || "Component";
HOC.displayName = "WithComponents(" + innerDisplayName + ")";
}
var ComponentsContext = _react2.default.createContext();

@@ -37,3 +52,3 @@

return _react2.default.forwardRef(function (props, ref) {
var WithComponents = _react2.default.forwardRef(function (props, ref) {
return _react2.default.createElement(

@@ -68,2 +83,10 @@ ComponentsContext.Consumer,

});
// https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over
(0, _hoistNonReactStatics2.default)(WithComponents, Component);
// https://reactjs.org/docs/higher-order-components.html#convention-wrap-the-display-name-for-easy-debugging
wrapDisplayName(WithComponents, Component);
return WithComponents;
}

6

package.json
{
"name": "@reactioncommerce/components-context",
"version": "1.0.0",
"version": "1.1.0",
"description": "A system for injecting React components into other React components from a central components context",

@@ -21,3 +21,5 @@ "main": "./dist/main.js",

"homepage": "https://github.com/reactioncommerce/components-context#readme",
"dependencies": {},
"dependencies": {
"hoist-non-react-statics": "^3.2.0"
},
"devDependencies": {

@@ -24,0 +26,0 @@ "@commitlint/cli": "7.0.0",

# @reactioncommerce/components-context
![npm (scoped)](https://img.shields.io/npm/v/@reactioncommerce/components-context.svg)
[![CircleCI](https://circleci.com/gh/reactioncommerce/components-context.svg?style=svg)](https://circleci.com/gh/reactioncommerce/components-context)
A system for injecting React components into other React components from a central components context.

@@ -4,0 +7,0 @@

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