Upgrading from V1
This guide will help you upgrade from Starknet React V1.
Updating dependencies
First, update all dependencies and double check that the installed version of
@starknet-react/core
is at least 2.0.0
.
Update StarknetConfig
Update the existing StarknetConfig
by adding the new chains
and provider
options. You also need to update the connectors
passed to it.
chains
: a list of chains supported by your dapp. The first chain in the list is the default chain, used when the user doesn't connect their wallet.provider
: an RPC provider. See the providers section for more information.connectors
: in v2, basic information about a wallet (like the id and name) must be provided. Starknet React provides helpers to initialize connectors for the most popular wallets.
Transaction manager
The transaction manager is now gone 💀 Fear not, it's easy to replace it using standard React tools 😇
This decision was not easy, but we noticed that the hook and context were cause of some issues and many teams decided to implement their own solution using their favourite state management library.
The easiest way to upgrade is by following the code in the transaction manager demo. Once you finish upgrading, you will have a transaction manager that's easier to customize and that persists the transaction list between page reloads.