Install package:
npm i @rebase-agency/react-polkadot-connect
or
yarn add @rebase-agency/react-polkadot-connect
Set up provider:
import {PolkadotProvider} from "@rebase-agency/react-polkadot-connect";
const root = createRoot(document.getElementById("root")!);
root.render(
<PolkadotProvider config={{
rpcLink: "..."
appName: "..."
}}>
<App />
</PolkadotProvider>
);
Then you can use hook for connect, account etc.:
import {usePolkadot} from "@rebase-agency/react-polkadot-connect";
const { address, connect, addresses, selectAddress } = usePolkadot()