-
Notifications
You must be signed in to change notification settings - Fork 133
Add react-core package with platform-agnostic hooks extracted from react-sdk #2733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR extracts platform-agnostic React hooks, utilities, and types from react-sdk into a new react-core package to enable code reuse across web and React Native platforms. The react-sdk now re-exports from react-core, maintaining backward compatibility.
Key changes:
- Created
@onflow/react-corepackage with platform-agnostic hooks and utilities - Migrated hooks to use
@onflow/fcl-coreinstead of@onflow/fclfor platform independence - Updated
react-sdkto re-export fromreact-corewith no breaking API changes
Reviewed changes
Copilot reviewed 91 out of 96 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react-core/* | New platform-agnostic package containing hooks, contexts, types, and utilities |
| packages/react-sdk/src/index.ts | Updated to re-export hooks and types from react-core |
| packages/react-sdk/src/provider/* | Updated imports to use react-core |
| packages/react-sdk/src/components/* | Updated imports to use react-core hooks |
| packages/fcl-core/src/* | Added FlowClientCore type export |
| .changeset/free-hats-hammer.md | Changeset documenting the refactor |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| to: "0x123", | ||
| data: "", | ||
| data: "abcdef123456", |
Copilot
AI
Dec 9, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test expects 'abcdef123456' but encodeCalls strips the '0x' prefix using sansPrefix. The mock returns '0xabcdef123456', so after sansPrefix the result should be 'abcdef123456'. However, the original test expected an empty string. This change may break the test if the mock implementation doesn't match the expected behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it properly mocks encodeFunctionData to return "0xabcdef123456" and verifies that sansPrefix correctly strips the 0x prefix to "abcdef123456". Master test was testing with undefined data (returning "")
Co-authored-by: Copilot <[email protected]>
Extracts platform-agnostic React hooks, utilities, and types from react-sdk into a new react-core package. This enables code reuse for React Native (via a future react-native-sdk) without pulling in web-specific dependencies. The react-sdk package now re-exports from react-core with no breaking changes to its public API.