@duffel/react-native-components
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

@duffel/react-native-components

UI components to support selling travel with the Duffel API in your react native app.

Installation

yarn add @duffel/react-native-components

Usage

import {
  DuffelCardForm,
  useDuffelCardFormActions,
} from '@duffel/react-native-components';

function App() {
  const { ref, createCardForTemporaryUse } = useDuffelCardFormActions();
  return (
    <DuffelCardForm
      ref={ref}
      clientKey={clientKey}
      intent="to-create-card-for-temporary-use"
      onValidateSuccess={() => createCardForTemporaryUse()}
      onCreateCardForTemporaryUseSuccess={({ id }) => setResult(id)}
      onValidateFailure={() => console.error('onValidateFailure')}
      onCreateCardForTemporaryUseFailure={(error) => {
        console.error('onCreateCardForTemporaryUseFailure', error);
      }}
    />
  );
}

For documentation and help integrating with this component please contact help@duffel.com

Package Sidebar

Install

npm i @duffel/react-native-components

Weekly Downloads

2,411

Version

2.0.1

License

MIT

Unpacked Size

1.48 MB

Total Files

962

Last publish

Collaborators

  • jameswair
  • idp
  • andrejak
  • duffel-bot
  • milesatduffel
  • stevedomin
  • jace-ys