We want this community to be friendly and respectful to each other. Please follow it in all your interactions with the project, and see our Code of Conduct.
This is a native module, so the JS specific code lives in src/ and the platform implementations live in android/ (Kotlin) and ios/ (Objective-C++).
The library actively supports New Architecture (Fabric) only
The repository is split into two packages: the library at the root, and the example app used to test changes.
Install the library dependencies from the root:
npm installThen install the example app dependencies:
cd example
npm installWhile developing, run the example app to test your changes. From the example/ directory:
To start the Metro packager:
npm startTo run the example app on Android:
npm run androidTo run the example app on iOS:
npm run iosTo run the example app on Web:
npm run webNative code changes (in
android/orios/) require a rebuild, so you have to re-runnpm run android/npm run iosrather than a fast refresh. Changes tosrc/newarch/regenerate codegen output on the next native build
We follow the conventional commits specification for our commit messages:
fix: bug fixes, (e.g. "fix: modal not dismissing on Android back press")feat: new features, (e.g. "feat: add a new prop to the modal component")refactor: code refactor, (e.g. "refactor: simplify the web stacking logic")docs: changes to documentation, (e.g. "docs: add a usage example to the README")test: adding or updating tests, (e.g. "test: add an e2e flow for rotation")chore: tooling changes, (e.g. "chore: change the CI config")
An optional scope may be used to indicate the affected platform, e.g. feat(web): or fix(ios):
cd example
npm run e2e:runScripts in the root package.json:
npm install: install the library dependencies.npm run lint: lintsrc/.npm run typecheck: type-check the library with TypeScript.npm run build: build the library with react-native-builder-bob.
Scripts in example/package.json (run from the example/ directory):
npm start: start the Metro server for the example app.npm run android: run the example app on Android.npm run ios: run the example app on iOS.npm run web: run the example app on Web.npm run typecheck: type-check the example app.npm run e2e:run: run the end-to-end screenshot tests.
Working on your first pull request? You can learn how from this free series: How to Contribute to an Open Source Project on GitHub.
When you're sending a pull request:
- Prefer small pull requests focused on one change.
- Verify that lint, type checking, and the build pass locally.
- If you touched native code, confirm the example app builds and runs on the affected platform.
- Review the documentation to make sure it looks good.
- Follow the pull request template when opening a pull request.
- For pull requests that change the API or native implementation, discuss with maintainers first by opening an issue.