Socket
Socket
Sign inDemoInstall

react-stripe-script-loader

Package Overview
Dependencies
0
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-stripe-script-loader

React component that lets load Stripe script and shows React Stripe Elements


Version published
Weekly downloads
526
increased by4.57%
Maintainers
1
Install size
380 kB
Created
Weekly downloads
 

Readme

Source

React Stripe Script Loader

npm version npm download

Github Pages Demo or Code Sandbox Demo

install

Install as a node module

npm i react-stripe-script-loader -S

usage

import React from 'react'
import StripeScriptLoader from 'react-stripe-script-loader'
import {
  StripeProvider,
  Elements,
  CardNumberElement,
} from 'react-stripe-elements'

const PageWithStripeElements = () => (
  <div>
    <h1>Stripe Elements</h1>
    <StripeScriptLoader
      uniqueId='myUniqueId'
      script='https://js.stripe.com/v3/'
      loader="Loading..."
    >
      <StripeProvider apiKey="stripeApiKey">
        <Elements>
          <CardNumberElement />
        </Elements>
      </StripeProvider>
    </StripeScriptLoader>
  </div>
)

export default PageWithStripeElements

props

uniqueId string

unique id for script element

script string

script to load

loader ReactElement

string, React elements array, React component

supports

supports all React version with hooks "react": "^16.9.0"

important note

For older versions of React ^15.0.0 please install following version with tag react-version-15

npm install react-stripe-script-loader@react-version-15 -S

Yusuf Özlü

Keywords

FAQs

Last updated on 26 Feb 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc