Skip to content

feat: <AppKitProvider>#4696

Merged
0xmkh merged 12 commits intomainfrom
feat/react-providers
Jul 23, 2025
Merged

feat: <AppKitProvider>#4696
0xmkh merged 12 commits intomainfrom
feat/react-providers

Conversation

@0xmkh
Copy link
Copy Markdown
Collaborator

@0xmkh 0xmkh commented Jul 23, 2025

Description

Introduced AppKitProvider React component for easy AppKit integration in React apps

Example usage

import { AppKitProvider } from '@reown/appkit/react';

function App() {
  return (
    <AppKitProvider projectId="YOUR_PROJECT_ID" networks={[/* Your Networks */]}>
      {/* Your App */}
    </AppKitProvider>
  );
}

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Associated Issues

For Linear issues: Closes APKT-3303

Showcase (Optional)

image

Checklist

  • Code in this PR is covered by automated tests (Unit tests, E2E tests)
  • My changes generate no new warnings
  • I have reviewed my own code
  • I have filled out all required sections
  • I have tested my changes on the preview link
  • Approver of this PR confirms that the changes are tested on the preview link

@linear
Copy link
Copy Markdown

linear bot commented Jul 23, 2025

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Jul 23, 2025

🦋 Changeset detected

Latest commit: 2af98f7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
@reown/appkit Patch
@reown/appkit-adapter-bitcoin Patch
@reown/appkit-adapter-ethers Patch
@reown/appkit-adapter-ethers5 Patch
@reown/appkit-adapter-solana Patch
@reown/appkit-adapter-wagmi Patch
@reown/appkit-utils Patch
@reown/appkit-cdn Patch
@reown/appkit-cli Patch
@reown/appkit-codemod Patch
@reown/appkit-common Patch
@reown/appkit-controllers Patch
@reown/appkit-core Patch
@reown/appkit-experimental Patch
@reown/appkit-pay Patch
@reown/appkit-polyfills Patch
@reown/appkit-scaffold-ui Patch
@reown/appkit-siwe Patch
@reown/appkit-siwx Patch
@reown/appkit-testing Patch
@reown/appkit-ui Patch
@reown/appkit-wallet Patch
@reown/appkit-wallet-button Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link
Copy Markdown

vercel bot commented Jul 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
appkit-basic-html ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2025 1:28pm
appkit-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2025 1:28pm
appkit-gallery ✅ Ready (Inspect) Visit Preview Jul 23, 2025 1:28pm
appkit-laboratory ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2025 1:28pm
10 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-basic-example ⬜️ Ignored (Inspect) Jul 23, 2025 1:28pm
appkit-basic-sign-client-example ⬜️ Ignored (Inspect) Jul 23, 2025 1:28pm
appkit-basic-up-example ⬜️ Ignored (Inspect) Jul 23, 2025 1:28pm
appkit-ethers5-bera ⬜️ Ignored (Inspect) Jul 23, 2025 1:28pm
appkit-nansen-demo ⬜️ Ignored (Inspect) Jul 23, 2025 1:28pm
appkit-vue-solana ⬜️ Ignored (Inspect) Jul 23, 2025 1:28pm
appkit-wagmi-cdn-example ⬜️ Ignored (Inspect) Jul 23, 2025 1:28pm
ethereum-provider-wagmi-example ⬜️ Ignored (Inspect) Jul 23, 2025 1:28pm
next-wagmi-solana-bitcoin-example ⬜️ Ignored (Inspect) Jul 23, 2025 1:28pm
vue-wagmi-example ⬜️ Ignored (Inspect) Jul 23, 2025 1:28pm

@socket-security
Copy link
Copy Markdown

socket-security bot commented Jul 23, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License

View full report

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 23, 2025

Warnings
⚠️

🔑 Potential High‑entropy string detected in packages/appkit/package.json (line 39): dist/types/exports/l...

⚠️

🔑 Potential High‑entropy string detected in packages/appkit/package.json (line 39): dist/types/exports/l...

Generated by 🚫 dangerJS against f81bab3

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 23, 2025

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.44% 31503 / 40679
🔵 Statements 77.44% 31503 / 40679
🔵 Functions 68.75% 2594 / 3773
🔵 Branches 84.46% 6638 / 7859
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/appkit/exports/react.ts 50% 100% 33.33% 50% 48-60, 63-70
packages/appkit/src/library/react/providers.ts 100% 100% 100% 100%
Generated in workflow #13650 for commit f81bab3 by the Vitest Coverage Report Action

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link
Copy Markdown
Collaborator

@tomiir tomiir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Memoization Ignores Prop Changes

The memoizeCreateAppKit function uses a module-level variable to memoize the AppKit instance. It only checks if the instance is null, causing it to ignore subsequent AppKitProvider prop changes (e.g., projectId, networks). This results in a single AppKit instance created with initial props, leading to stale configuration and incorrect behavior.

packages/appkit/src/library/react/providers.ts#L10-L26

// -- State --------------------------------------------------------------------------------
let appkit: ReturnType<typeof createAppKit> | null = null
// -- Utils & Others -----------------------------------------------------------------------
export function memoizeCreateAppKit(config: CreateAppKit) {
if (!appkit) {
appkit = createAppKit(config)
}
return appkit
}
// -- Providers ----------------------------------------------------------------------------
export function AppKitProvider({ children, ...props }: AppKitProviderProps) {
memoizeCreateAppKit(props)
return children

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants