Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 27 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ We want this community to be friendly and respectful to each other. Please follo

This project is a monorepo managed using [Yarn workspaces](https://yarnpkg.com/features/workspaces). It contains the following packages:

- The library package in the root directory.
- An example app in the `example/` directory.
- The core library package in the `packages` directory
- React Native example app in `apps/example`
- Expo example app in `apps/example-expo`

To get started with the project, run `yarn` in the root directory to install the required dependencies for each package:

Expand All @@ -19,46 +20,54 @@ yarn

> Since the project relies on Yarn workspaces, you cannot use [`npm`](https://github.com/npm/cli) for development.

The [example app](/example/) demonstrates usage of the library. You need to run it to test any changes you make.
The example apps in the `apps` directory demonstrate usage of the library. You need to run one of them to test any changes you make.

It is configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example app. Changes to the library's JavaScript code will be reflected in the example app without a rebuild, but native code changes will require a rebuild of the example app.
They are configured to use the local version of the library, so any changes you make to the library's source code will be reflected in the example apps. Changes to the library's JavaScript code will be reflected without a rebuild, but native code changes will require a rebuild of the example app.

If you want to use Android Studio or XCode to edit the native code, you can open the `example/android` or `example/ios` directories respectively in those editors. To edit the Objective-C or Swift files, open `example/ios/SwiftuiTabviewExample.xcworkspace` in XCode and find the source files at `Pods > Development Pods > react-native-bottom-tabs`.

To edit the Java or Kotlin files, open `example/android` in Android studio and find the source files at `react-native-bottom-tabs` under `Android`.
If you want to use Android Studio or XCode to edit the native code, you can open the `apps/example/android` or `apps/example/ios` directories respectively in those editors.

You can use various commands from the root directory to work with the project.

To start the packager:
To start the packager for the React Native example:

```sh
yarn workspace react-native-bottom-tabs-example start
```

To run the React Native example app on Android:

```sh
yarn example start
yarn workspace react-native-bottom-tabs-example android
```

To run the example app on Android:
To run the React Native example app on iOS:

```sh
yarn example android
cd apps/example/ios
pod install
cd -
yarn ios
```

To run the example app on iOS:
To run the Expo example:

```sh
yarn example ios
yarn workspace example-expo start
```

By default, the example is configured to build with the old architecture. To run the example with the new architecture, you can do the following:

1. For Android, run:

```sh
ORG_GRADLE_PROJECT_newArchEnabled=true yarn example android
cd apps/example
ORG_GRADLE_PROJECT_newArchEnabled=true yarn android
```

2. For iOS, run:

```sh
cd example/ios
cd apps/example/ios
RCT_NEW_ARCH_ENABLED=1 pod install
cd -
yarn example ios
Expand Down Expand Up @@ -136,9 +145,9 @@ The `package.json` file contains various scripts for common tasks:
- `yarn typecheck`: type-check files with TypeScript.
- `yarn lint`: lint files with ESLint.
- `yarn test`: run unit tests with Jest.
- `yarn example start`: start the Metro server for the example app.
- `yarn example android`: run the example app on Android.
- `yarn example ios`: run the example app on iOS.
- `yarn workspace react-native-bottom-tabs-example start`: start the Metro server for the example app.
- `yarn workspace react-native-bottom-tabs-example android`: run the example app on Android.
- `yarn workspace react-native-bottom-tabs-example ios`: run the example app on iOS.

### Sending a pull request

Expand Down
Loading