Thanks for your interest in contributing to react-native-expandable-bottom-sheet! This document walks you through the process.
- Node.js >= 18
- npm or yarn
- A working React Native development environment (setup guide)
-
Fork and clone the repository:
git clone https://github.com/<your-username>/react-native-expandable-bottom-sheet.git cd react-native-expandable-bottom-sheet
-
Install dependencies:
npm install
-
Build the library:
npm run build
| Script | Description |
|---|---|
npm run build |
Build CommonJS, ESM, and TypeScript declarations into lib/ |
npm run typecheck |
Run the TypeScript compiler in check-only mode |
npm run lint |
Lint the src/ directory with ESLint |
npm test |
Run the Jest test suite |
npm run example:start |
Start Metro bundler for the example app |
npm run example:ios |
Run the example app on iOS |
npm run example:android |
Run the example app on Android |
-
Create a new branch from
develop:git checkout -b feature/my-change develop
-
Make your changes in
src/. -
Verify everything passes:
npm run typecheck npm run lint npm test npm run build -
Commit your changes with a clear, descriptive message.
The example/ directory contains a React Native 0.76 app that demonstrates the component. It links to the library source via file:.., so your local changes are reflected immediately.
-
Install example dependencies:
cd example npm install -
Install iOS pods (first time or after adding native deps):
cd ios && bundle install && LANG=en_US.UTF-8 bundle exec pod install && cd ..
If you see a
Unicode Normalizationerror, theLANG=en_US.UTF-8prefix is required. You can also addexport LANG=en_US.UTF-8to your shell profile (~/.zprofileor~/.bashrc) to avoid repeating it. -
Run the app:
# From the repo root npm run example:ios # or npm run example:android
-
Start Metro with cache reset (if you see stale code):
npm run example:start -- --reset-cache
The example app has two tabs:
- Now Playing — Demonstrates
renderPreviewwith a music player teaser bar. Tap or swipe up to see a playlist queue with album art loaded via FastImage. - Comments — Demonstrates the modal-style (no preview) variant triggered by a button. Expands to show a mock comment section with avatars.
To test the published package experience (without file: linking):
-
From the library root, build and pack:
npm run build npm pack
-
In any React Native app, install from the tarball:
npm install /path/to/react-native-expandable-bottom-sheet-0.1.0.tgz
-
Rebuild the native app (a JS-only reload is not enough):
cd ios && pod install && cd .. npx react-native run-ios
- Push your branch to your fork.
- Open a pull request against the
developbranch. - Fill in a clear description of what changed and why.
- Make sure all checks pass (typecheck, lint, tests, build).
- Keep pull requests focused — one feature or fix per PR.
- If your change affects behavior, update or add tests.
- If your change affects the public API (props, ref methods, exports), update the README and types.
- Don't bump the version number — that's handled during the release process.
- TypeScript strict mode is enabled. Avoid
anywhere possible. - Use functional components and hooks.
- Keep platform-specific code in the appropriate files (
*.ios.tsx/*.android.tsx). - Write JSDoc comments for exported types and interfaces.
When filing a bug report, please include:
- React Native version and architecture (Old / New)
- react-native-reanimated and react-native-gesture-handler versions
- Platform (iOS, Android, or both)
- Reproduction steps — a minimal code snippet or repo is ideal
- Expected vs. actual behavior
By contributing, you agree that your contributions will be licensed under the MIT License.