feat: Add React hooks wrapper package#63
Merged
big14way merged 1 commit intosorosave-protocol:mainfrom Feb 25, 2026
Merged
Conversation
- Add SoroSaveProvider context component for SDK access - Add useGroup hook for fetching group data - Add useContribute hook for contribution mutations - Add useMemberGroups hook for fetching member's groups - Update package.json with React peer dependency and subpath exports - Update README with React hooks documentation Closes sorosave-protocol#45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a React hooks wrapper package for the SoroSave SDK, making it easy to integrate SoroSave into React applications.
Changes
New Files
src/react/context.tsx- SoroSaveProvider component and hooks for accessing client/configsrc/react/useGroup.ts- Hook for fetching and monitoring a savings groupsrc/react/useContribute.ts- Mutation hook for making contributionssrc/react/useMemberGroups.ts- Hook for fetching all groups a member belongs tosrc/react/index.ts- Public exports for the React packageModified Files
package.json- Added React peer dependency and subpath exports for@sorosave/reacttsconfig.json- Added JSX support for React componentssrc/index.ts- Re-export React hooksREADME.md- Added comprehensive React hooks documentationUsage
Acceptance Criteria
useGroup(groupId)hook returning group data + loading + erroruseContribute()hook returning mutation functionuseMemberGroups(address)hookSoroSaveProvidercontext componentCloses #45