Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/neat-parrots-shout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'wagmi': patch
---

add `WagmiProvider` alias for `Provider`
6 changes: 6 additions & 0 deletions docs/pages/docs/provider.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ The **Provider** manages configuration for all hooks using [React Context](https
import { Provider } from 'wagmi'
```

To help avoid conflicts with other providers in your app, the **Provider** is also aliased as **WagmiProvider**.

```tsx
import { WagmiProvider } from 'wagmi'
```

## Usage

```tsx
Expand Down
5 changes: 5 additions & 0 deletions packages/react/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ it('should expose correct exports', () => {
expect(Object.keys(Exports)).toMatchInlineSnapshot(`
[
"Provider",
"WagmiProvider",
"useContext",
"Context",
"useAccount",
Expand Down Expand Up @@ -46,3 +47,7 @@ it('should expose correct exports', () => {
]
`)
})

it('should alias Provider as WagmiProvider', () => {
expect(Exports.Provider).toBe(Exports.WagmiProvider)
})
12 changes: 10 additions & 2 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
export { Provider, useContext, Context } from './context'
export type { Props as ProviderProps } from './context'
export {
Provider,
Provider as WagmiProvider,
useContext,
Context,
} from './context'
export type {
Props as ProviderProps,
Props as WagmiProviderProps,
} from './context'

export {
useAccount,
Expand Down