Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor processOptions to prevent modifying its arguments #594

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

matheusrufca
Copy link

Removed delete statements from processOptions function to prevent modifying its argument and having side-effects.

Deleting sdkBaseUrl property is causing to React script loader to not properly set a custom sdkBaseUrl because useEffect is running twice.

@matheusrufca matheusrufca requested a review from a team as a code owner December 11, 2024 21:14
Copy link

changeset-bot bot commented Dec 11, 2024

🦋 Changeset detected

Latest commit: 48bd621

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@paypal/paypal-js Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@matheusrufca matheusrufca marked this pull request as draft December 11, 2024 21:19
@matheusrufca matheusrufca changed the title replaced 'delete' statements by spread operator Refactor processOptions to prevent modifying its arguments Dec 11, 2024
@matheusrufca matheusrufca marked this pull request as ready for review December 12, 2024 16:06
? "https://www.sandbox.paypal.com/sdk/js"
: "https://www.paypal.com/sdk/js";
// env is not an allowed key for sdk/js url.
delete options.environment;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need to keep this line though? if environment isn't an allowed param for sdk/js URL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants