DefinitelyTyped/types/react-plaid-link/react-plaid-link-tests.tsx
Keevan Dance 30d741a1a8 Feature/add react plaid link (#37031)
* Add types

* initial commit

* add delcaration file and tests for react-plaid-link

* remove path mapping

* add typescript version

* change array type for non-simple types
2019-07-22 12:55:28 -07:00

55 lines
1.5 KiB
TypeScript

import * as React from 'react';
import PlaidLink from 'react-plaid-link';
import { render } from 'react-dom';
// render(<PlaidLink />, document.getElementById('app'));
const AllProps = () => {
return (
<PlaidLink
apiVersion="test"
clientName="test"
env="tartan"
institution="test"
publicKey="123123asdasd123123"
product={[
'connect',
'info',
'auth',
'identity',
'income',
'transactions',
'assets',
'holdings',
'liabilities',
]}
token="test"
user={{ legalName: 'Keevan', emailAddress: 'testuser@gmail.com' }}
selectAccount={true}
webhook="yes please"
onSuccess={(publicToken, metadata) => {}}
onExit={(error, metadata) => {}}
onLoad={() => {}}
onEvent={(eventName, metadata) => {}}
style={{ backgroundColor: 'blue' }}
className="new-classname"
/>
);
};
const RequiredProps = () => {
return (
<PlaidLink
clientName="test"
env="sandbox"
publicKey="test"
product={['info']}
onSuccess={(publicToken, metadata) => {}}
/>
);
};
render(<AllProps />, document.getElementById('app'));
render(<RequiredProps />, document.getElementById('app'));