@duffel/react-native-components
v0.2.2
Published
UI components to support selling travel with the Duffel API
Downloads
1,245
Readme
@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 [email protected]