@ckb-ccc/connector-react is the recommended integration layer for React and Next.js applications. It provides a context Provider, a useCcc hook that exposes the full connector state, and a useSigner hook that returns the active signer whenever a wallet is connected.
Installation
- npm
- yarn
- pnpm
Provider
Wrap your application (or the subtree that needs wallet access) withccc.Provider. It renders the wallet selection modal and makes the connector context available to all descendant components.
Props
All props are optional except
children.useCcc
useCcc() returns the full connector context. Call it inside any component that is a descendant of ccc.Provider.
Return value
useSigner
useSigner() is a convenience hook that returns the active ccc.Signer directly. It returns undefined while no wallet is connected.