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

[BUG] PayPal Button shows duplicate, double buttons #126

Open
2 tasks done
OmerMessing opened this issue May 23, 2022 · 5 comments
Open
2 tasks done

[BUG] PayPal Button shows duplicate, double buttons #126

OmerMessing opened this issue May 23, 2022 · 5 comments

Comments

@OmerMessing
Copy link

OmerMessing commented May 23, 2022

To Do First

  • Did you try latest release? - Yes.
  • Did you look for existing matching issues? - Yes.

Software Package Version:
v2.6.3

Describe the bug

I see the PayPal button double, I tried downgrading to [email protected] but I still see the same result.
I tried moving the button in the page to different places in the code but it always shows double buttons.

The button is working but I also have this error in the console:

b.sbox.stats.paypal.com/v2/counter.cgi?p=uid_3890f557ca_mtu6mdc6nda&s=SMART_PAYMENT_BUTTONS:1 Failed to load resource: net::ERR_CONNECTION_REFUSED

To Reproduce

  1. Put the PayPalButton somewhere in your code with the required props and run the page on the browser.

Expected behavior

A single button is supposed to render.

Screenshots

Screen Shot 2022-05-23 at 18 21 42

Desktop (please complete the following information):

  • OS: [e.g. iOS] MacOS
  • Browser: [e.g. chrome, safari] Chrome
  • React Version: [e.g. 22] 18.0.0

Additional context

@DominicHulsey
Copy link

DominicHulsey commented Jun 4, 2022

I had this issue also OmerMessing, figured it out. Using strictMode causes duplicate render. disable this in app initialization. If you used create-react-app and typescript like I did, do this in App.tsx:

const root = ReactDOM.createRoot(
  document.getElementById("root") as HTMLElement
);
root.render(
  //remove this tag
  // <React.StrictMode>
    <App />
  // </React.StrictMode>
);

@lmwenda
Copy link

lmwenda commented Aug 17, 2022

i got this as well i'm using nextjs

@wangxingxing123654
Copy link

+1

@nabilzouhir
Copy link

If you're using NextJS go to next.config.js and set reactStrictMode: false

@vignyl
Copy link

vignyl commented Sep 25, 2024

if i don't want to remove strict mode what is the solution

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

No branches or pull requests

6 participants