Skip to content

Latest commit

 

History

History
163 lines (111 loc) · 4.43 KB

File metadata and controls

163 lines (111 loc) · 4.43 KB

Contributing

Thanks for your interest in contributing to react-native-expandable-bottom-sheet! This document walks you through the process.

Prerequisites

  • Node.js >= 18
  • npm or yarn
  • A working React Native development environment (setup guide)

Getting Started

  1. Fork and clone the repository:

    git clone https://github.com/<your-username>/react-native-expandable-bottom-sheet.git
    cd react-native-expandable-bottom-sheet
  2. Install dependencies:

    npm install
  3. Build the library:

    npm run build

Development Workflow

Available Scripts

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

Making Changes

  1. Create a new branch from develop:

    git checkout -b feature/my-change develop
  2. Make your changes in src/.

  3. Verify everything passes:

    npm run typecheck
    npm run lint
    npm test
    npm run build
  4. Commit your changes with a clear, descriptive message.

Running the Example App

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.

  1. Install example dependencies:

    cd example
    npm install
  2. 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 Normalization error, the LANG=en_US.UTF-8 prefix is required. You can also add export LANG=en_US.UTF-8 to your shell profile (~/.zprofile or ~/.bashrc) to avoid repeating it.

  3. Run the app:

    # From the repo root
    npm run example:ios
    # or
    npm run example:android
  4. 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 renderPreview with 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.

Testing with a Tarball

To test the published package experience (without file: linking):

  1. From the library root, build and pack:

    npm run build
    npm pack
  2. In any React Native app, install from the tarball:

    npm install /path/to/react-native-expandable-bottom-sheet-0.1.0.tgz
  3. Rebuild the native app (a JS-only reload is not enough):

    cd ios && pod install && cd ..
    npx react-native run-ios

Submitting a Pull Request

  1. Push your branch to your fork.
  2. Open a pull request against the develop branch.
  3. Fill in a clear description of what changed and why.
  4. Make sure all checks pass (typecheck, lint, tests, build).

PR Guidelines

  • 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.

Code Style

  • TypeScript strict mode is enabled. Avoid any where 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.

Reporting Bugs

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

License

By contributing, you agree that your contributions will be licensed under the MIT License.