1.2 KiB
1.2 KiB
title, titleTemplate, description
| title | titleTemplate | description |
|---|---|---|
| Migrate from v1 to v2 | Wagmi CLI | Guide for migrating from Wagmi CLI v1 to v2. |
Migrate from v1 to v2
To get started, install the latest version of the Wagmi CLI.
::: code-group
pnpm add @wagmi/cli
npm install @wagmi/cli
yarn add @wagmi/cli
bun add @wagmi/cli
:::
::: info Not ready to migrate yet? The Wagmi CLI v1 docs are still available at 1.x.wagmi.sh/cli. :::
Changed generated action and hook names
Generated action and hook names now align with Wagmi v2 naming conventions. If you want hooks to still follow Wagmi v1 naming conventions, set getActionName and getHookName to 'legacy'.
import { defineConfig } from '@wagmi/cli'
import { actions, react } from '@wagmi/cli/plugins'
export default defineConfig({
plugins: [
actions({
getActionName: 'legacy', // [!code focus]
}),
react({
getHookName: 'legacy', // [!code focus]
}),
],
})