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

react-overridable

Package Overview
Dependencies
Maintainers
3
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-overridable - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

CHANGELOG.md

13

dist/cjs/index.js

@@ -1,3 +0,1 @@

'use strict';
Object.defineProperty(exports, '__esModule', { value: true });

@@ -59,10 +57,7 @@

const overriddenComponents = React.useContext(OverridableContext);
const child = children ? React__default.Children.only(children) : null; // throws an error if multiple children
const child = children ? React__default.Children.only(children) : null;
const childProps = child ? child.props : {};
const hasOverriddenComponent = (id in overriddenComponents);
if (hasOverriddenComponent) {
// If there's an override, we replace the component's content with
// the override + props
if (id in overriddenComponents) {
// If there's an override, we replace the component's content with the override + props
const Overridden = overriddenComponents[id];

@@ -145,6 +140,6 @@ return React__default.createElement(Overridden, _objectSpread(_objectSpread({}, childProps), restProps));

}
const overrideStore = new OverriddenComponentRepository();
exports.OverridableContext = OverridableContext;
exports.OverriddenComponentRepository = OverriddenComponentRepository;
exports.default = Overridable;

@@ -151,0 +146,0 @@ exports.overrideStore = overrideStore;

@@ -52,10 +52,7 @@ import _defineProperty from '@babel/runtime/helpers/defineProperty';

const overriddenComponents = useContext(OverridableContext);
const child = children ? React.Children.only(children) : null; // throws an error if multiple children
const child = children ? React.Children.only(children) : null;
const childProps = child ? child.props : {};
const hasOverriddenComponent = (id in overriddenComponents);
if (hasOverriddenComponent) {
// If there's an override, we replace the component's content with
// the override + props
if (id in overriddenComponents) {
// If there's an override, we replace the component's content with the override + props
const Overridden = overriddenComponents[id];

@@ -138,7 +135,6 @@ return React.createElement(Overridden, _objectSpread(_objectSpread({}, childProps), restProps));

}
const overrideStore = new OverriddenComponentRepository();
export default Overridable;
export { OverridableContext, overrideStore, parametrize };
export { OverridableContext, OverriddenComponentRepository, overrideStore, parametrize };
//# sourceMappingURL=index.js.map
{
"name": "react-overridable",
"version": "0.0.2",
"version": "0.0.3",
"description": "Makes React components overridable.",

@@ -5,0 +5,0 @@ "keywords": [

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