React 16.8+ hook and components for integrating with Deck Link
yarn add react-deck-link
import { useDeckLink } from 'react-deck-link';
const OpenLink = () => {
const { open, isError, isReady } = useDeckLink({
token: '<GENERATED_LINK_TOKEN>',
onSuccess: (public_token, metadata) => {
// send public_token to server
},
});
if (isError) {
return <div>Uh oh!</div>;
}
return (
<button onClick={open} disabled={!isReady}>Connect</button>
);
}
Please refer to the official Deck Link docs for a more holistic understanding of Deck Link.
This project is set up using Vite.
yarn
npx vite # start dev server
To test a local version of this library:
yarn link
cd ../dashboard
yarn link react-deck-link
npx vite build
yarn publish