@paypal/react-paypal-js
Advanced tools
Comparing version 5.2.0 to 6.0.0
@@ -5,2 +5,12 @@ # Changelog | ||
## [6.0.0](https://github.com/paypal/react-paypal-js/compare/v5.2.0...v6.0.0) (2021-04-12) | ||
### ⚠ BREAKING CHANGES | ||
- forceReRender prop now accepts an array. | ||
### Features | ||
- update forceReRender to be an array ([#102](https://github.com/paypal/react-paypal-js/issues/102)) ([c41ee40](https://github.com/paypal/react-paypal-js/commit/c41ee40e6899f86f2300285c4826203458f457e5)) | ||
## [5.2.0](https://github.com/paypal/react-paypal-js/compare/v5.1.2...v5.2.0) (2021-04-05) | ||
@@ -7,0 +17,0 @@ |
import { FunctionComponent, ReactElement } from "react"; | ||
import type { PayPalButtonsComponentProps } from "@paypal/paypal-js/types/components/buttons"; | ||
export interface PayPalButtonsReactProps extends PayPalButtonsComponentProps { | ||
import type { PayPalButtonsComponentOptions } from "@paypal/paypal-js/types/components/buttons"; | ||
export interface PayPalButtonsComponentProps extends PayPalButtonsComponentOptions { | ||
/** | ||
@@ -8,3 +8,3 @@ * Used to re-render the component. | ||
*/ | ||
forceReRender?: unknown; | ||
forceReRender?: unknown[]; | ||
/** | ||
@@ -33,2 +33,2 @@ * Pass a css class to the div container. | ||
*/ | ||
export declare const PayPalButtons: FunctionComponent<PayPalButtonsReactProps>; | ||
export declare const PayPalButtons: FunctionComponent<PayPalButtonsComponentProps>; |
import { FunctionComponent } from "react"; | ||
import type { PayPalMarksComponentProps } from "@paypal/paypal-js/types/components/marks"; | ||
export interface PayPalMarksReactProps extends PayPalMarksComponentProps { | ||
import type { PayPalMarksComponentOptions } from "@paypal/paypal-js/types/components/marks"; | ||
export interface PayPalMarksComponentProps extends PayPalMarksComponentOptions { | ||
/** | ||
@@ -31,2 +31,2 @@ * Pass a css class to the div container. | ||
*/ | ||
export declare const PayPalMarks: FunctionComponent<PayPalMarksReactProps>; | ||
export declare const PayPalMarks: FunctionComponent<PayPalMarksComponentProps>; |
import { FunctionComponent } from "react"; | ||
import type { PayPalMessagesComponentProps } from "@paypal/paypal-js/types/components/messages"; | ||
export interface PayPalMessagesReactProps extends PayPalMessagesComponentProps { | ||
forceReRender?: unknown; | ||
import type { PayPalMessagesComponentOptions } from "@paypal/paypal-js/types/components/messages"; | ||
export interface PayPalMessagesComponentProps extends PayPalMessagesComponentOptions { | ||
forceReRender?: unknown[]; | ||
className?: string; | ||
} | ||
export declare const PayPalMessages: FunctionComponent<PayPalMessagesReactProps>; | ||
export declare const PayPalMessages: FunctionComponent<PayPalMessagesComponentProps>; |
@@ -0,1 +1,9 @@ | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
@@ -27,3 +35,3 @@ | ||
/*! | ||
* paypal-js v3.1.5 (2021-03-29T22:14:31.678Z) | ||
* paypal-js v3.1.7 (2021-04-10T17:17:47.380Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -410,3 +418,4 @@ * | ||
children = _ref3$children === void 0 ? null : _ref3$children, | ||
forceReRender = _ref3.forceReRender, | ||
_ref3$forceReRender = _ref3.forceReRender, | ||
forceReRender = _ref3$forceReRender === void 0 ? [] : _ref3$forceReRender, | ||
buttonProps = _objectWithoutProperties(_ref3, ["className", "disabled", "children", "forceReRender"]); | ||
@@ -494,3 +503,3 @@ | ||
return closeButtonsComponent; | ||
}, [isResolved, forceReRender, buttonProps.fundingSource]); // useEffect hook for managing disabled state | ||
}, [isResolved].concat(_toConsumableArray(forceReRender), [buttonProps.fundingSource])); // useEffect hook for managing disabled state | ||
@@ -650,3 +659,4 @@ useEffect(function () { | ||
className = _ref7$className === void 0 ? "" : _ref7$className, | ||
forceReRender = _ref7.forceReRender, | ||
_ref7$forceReRender = _ref7.forceReRender, | ||
forceReRender = _ref7$forceReRender === void 0 ? [] : _ref7$forceReRender, | ||
messageProps = _objectWithoutProperties(_ref7, ["className", "forceReRender"]); | ||
@@ -700,3 +710,3 @@ | ||
}); | ||
}, [isResolved, forceReRender]); | ||
}, [isResolved].concat(_toConsumableArray(forceReRender))); | ||
return React.createElement("div", { | ||
@@ -703,0 +713,0 @@ ref: messagesContainerRef, |
@@ -12,3 +12,3 @@ 'use strict'; | ||
/*! | ||
* paypal-js v3.1.5 (2021-03-29T22:14:31.678Z) | ||
* paypal-js v3.1.7 (2021-04-10T17:17:47.380Z) | ||
* Copyright 2020-present, PayPal, Inc. All rights reserved. | ||
@@ -367,3 +367,3 @@ * | ||
*/ | ||
const PayPalButtons = ({ className = "", disabled = false, children = null, forceReRender, ...buttonProps }) => { | ||
const PayPalButtons = ({ className = "", disabled = false, children = null, forceReRender = [], ...buttonProps }) => { | ||
const buttonsContainerRef = React.useRef(null); | ||
@@ -428,3 +428,3 @@ const buttons = React.useRef(null); | ||
return closeButtonsComponent; | ||
}, [isResolved, forceReRender, buttonProps.fundingSource]); | ||
}, [isResolved, ...forceReRender, buttonProps.fundingSource]); | ||
// useEffect hook for managing disabled state | ||
@@ -546,3 +546,3 @@ React.useEffect(() => { | ||
const PayPalMessages = ({ className = "", forceReRender, ...messageProps }) => { | ||
const PayPalMessages = ({ className = "", forceReRender = [], ...messageProps }) => { | ||
const [{ isResolved, options }] = usePayPalScriptReducer(); | ||
@@ -582,3 +582,3 @@ const messagesContainerRef = React.useRef(null); | ||
}); | ||
}, [isResolved, forceReRender]); | ||
}, [isResolved, ...forceReRender]); | ||
return React__default['default'].createElement("div", { ref: messagesContainerRef, className: className }); | ||
@@ -585,0 +585,0 @@ }; |
{ | ||
"name": "@paypal/react-paypal-js", | ||
"version": "5.2.0", | ||
"version": "6.0.0", | ||
"description": "React components for the PayPal JS SDK", | ||
@@ -44,8 +44,8 @@ "keywords": [ | ||
"dependencies": { | ||
"@paypal/paypal-js": "^3.1.5", | ||
"@paypal/sdk-constants": "^1.0.96" | ||
"@paypal/paypal-js": "^3.1.7", | ||
"@paypal/sdk-constants": "^1.0.100" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.13.14", | ||
"@babel/preset-env": "^7.13.12", | ||
"@babel/core": "^7.13.15", | ||
"@babel/preset-env": "^7.13.15", | ||
"@babel/preset-react": "^7.13.13", | ||
@@ -59,16 +59,16 @@ "@babel/preset-typescript": "^7.13.0", | ||
"@rollup/plugin-typescript": "^8.2.1", | ||
"@storybook/addon-actions": "^6.2.1", | ||
"@storybook/addon-essentials": "^6.2.1", | ||
"@storybook/addon-links": "^6.2.1", | ||
"@storybook/react": "^6.2.1", | ||
"@storybook/addon-actions": "^6.2.7", | ||
"@storybook/addon-essentials": "^6.2.7", | ||
"@storybook/addon-links": "^6.2.7", | ||
"@storybook/react": "^6.2.7", | ||
"@storybook/storybook-deployer": "^2.8.7", | ||
"@testing-library/react": "^11.2.6", | ||
"@types/react": "^17.0.3", | ||
"@typescript-eslint/eslint-plugin": "^4.20.0", | ||
"@typescript-eslint/parser": "^4.20.0", | ||
"@typescript-eslint/eslint-plugin": "^4.21.0", | ||
"@typescript-eslint/parser": "^4.21.0", | ||
"babel-jest": "^26.6.3", | ||
"babel-loader": "^8.2.2", | ||
"eslint": "^7.23.0", | ||
"eslint": "^7.24.0", | ||
"eslint-config-prettier": "^8.1.0", | ||
"eslint-plugin-react": "^7.23.1", | ||
"eslint-plugin-react": "^7.23.2", | ||
"husky": "^6.0.0", | ||
@@ -82,6 +82,6 @@ "jest": "^26.6.3", | ||
"react-is": "^17.0.2", | ||
"rollup": "^2.44.0", | ||
"rollup": "^2.45.1", | ||
"shelljs": "^0.8.4", | ||
"standard-version": "^9.1.1", | ||
"typescript": "^4.2.3" | ||
"standard-version": "^9.2.0", | ||
"typescript": "^4.2.4" | ||
}, | ||
@@ -88,0 +88,0 @@ "peerDependencies": { |
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
84230
1320
Updated@paypal/paypal-js@^3.1.7