Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

any idea how to pass down style props in to @paypal/paypal-js PayPalButtons component?

I am using @paypal/paypal-js from npm in react app to integrate payment, any idea how to pass down style props in the button component that this library offers ?

// Style logic form paypal devoloper
paypal.Buttons({
  style: {
    layout:  'vertical',
    color:   'blue',
    shape:   'rect',
    label:   'paypal'
  }
}).render('#paypal-button-container');

// module
import React from 'react';
import {  PayPalButtons } from '@paypal/react-paypal-js';

interface Props {}

export const PaypalCheckoutButtons: React.FC<Props> = ({}) => {
  return <PayPalButtons />;
};

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

There are some examples in the documentation. For your case:

    <PayPalButtons
        style={{
            layout:  'vertical',
            color:   'blue',
            shape:   'rect',
            label:   'paypal'
        }}
    />
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading