MCPcopy
hub / github.com/react-navigation/react-navigation

github.com/react-navigation/react-navigation @react-navigation@4.4.5 sqlite

repository ↗ · DeepWiki ↗ · release react-navigation@4.4.5 ↗
888 symbols 1,720 edges 172 files 15 documented · 2%
README

React Navigation 4

Build Status Code Coverage MIT License

Routing and navigation for your React Native apps.

Documentation can be found at reactnavigation.org.

Contributing

The project uses a monorepo structure for the packages managed by yarn workspaces and lerna. To get started with the project, run yarn in the root directory to install the required dependencies for each package:

yarn

While developing, you can run the example app with Expo to test your changes:

yarn example start

Make sure your code passes TypeScript and ESLint. Run the following to verify:

yarn typescript
yarn lint

To fix formatting errors, run the following:

yarn lint --fix

Remember to add tests for your change if possible. Run the unit tests by:

yarn test

Running the e2e tests with Detox (on iOS) requires the following:

  • Mac with macOS (at least macOS High Sierra 10.13.6)
  • Xcode 10.1+ with Xcode command line tools

First you need to install applesimutils and detox-cli:

brew tap wix/brew
brew install applesimutils
yarn global add detox-cli

Then you can build and run the tests:

detox build -c ios.sim.debug
detox test -c ios.sim.debug

Publishing

To publish a new version, first we need to export a GH_TOKEN environment variable as mentioned here. Then run:

yarn lerna publish

This will automatically bump the version and publish the packages. It'll also publish the changelogs on GitHub for each package.

Installing from a fork on GitHub

Since we use a monorepo, it's not possible to install a package from the repository URL. If you need to install a forked version from Git, you can use gitpkg.

First install gitpkg:

yarn global add gitpkg

Then follow these steps to publish and install a forked package:

  1. Fork this repo to your account and clone the forked repo to your local machine
  2. Open a Terminal and cd to the location of the cloned repo
  3. Run yarn to install any dependencies
  4. If you want to make any changes, make them and commit
  5. Now cd to the package directory that you want to use (e.g. cd packages/stack for @react-navigation/stack)
  6. Run gitpkg publish to publish the package to your repo

After publishing, you should see something like this:

Package uploaded to git@github.com:<user>/<repo>.git with the name <name>

You can now install the dependency in your project:

yarn add <user>/<repo>.git#<name>

Remember to replace <user>, <repo> and <name> with right values.

Extension points exported contracts — how you extend this code

State (Interface)
(no doc)
example/App.tsx
Props (Interface)
(no doc)
example/src/CustomTabUI.tsx
NavigationParams (Interface)
(no doc)
packages/core/src/NavigationActions.ts
DrawerItem (Interface)
(no doc)
packages/drawer/src/types.tsx
NavigationState (Interface)
(no doc)
packages/react-navigation/typescript/react-navigation.d.ts
BaseAnimation (Interface)
(no doc)
packages/tabs/src/types.tsx
MyNavScreenProps (Interface)
(no doc)
example/src/StackWithCustomHeaderBackImage.tsx
NavigationNavigateActionPayload (Interface)
(no doc)
packages/core/src/NavigationActions.ts

Core symbols most depended-on inside this repo

navigate
called by 134
packages/react-navigation/typescript/react-navigation.d.ts
StackRouter
called by 74
packages/core/src/index.js
TabRouter
called by 39
packages/core/src/index.js
createStackNavigator
called by 30
packages/react-navigation/src/deprecations.js
invariant
called by 23
packages/core/src/utils/invariant.ts
throwError
called by 21
packages/react-navigation/src/deprecations.js
createAppContainer
called by 20
packages/native/src/index.js
tabBarIcon
called by 16
example/src/BottomTabs.tsx

Shape

Function 329
Class 267
Method 208
Interface 84

Languages

TypeScript100%

Modules by API surface

packages/react-navigation/typescript/react-navigation.d.ts61 symbols
packages/core/src/index.js28 symbols
packages/react-navigation/src/deprecations.js23 symbols
packages/native/src/createAppContainer.js19 symbols
example/src/StackWithCustomHeaderBackImage.tsx19 symbols
packages/native/src/index.js18 symbols
packages/core/src/routers/__tests__/StackRouter.test.js18 symbols
packages/core/src/routers/__tests__/Routers.test.js18 symbols
example/src/StackWithTranslucentHeader.tsx18 symbols
example/src/CustomTabUI.tsx17 symbols
packages/core/src/routers/__tests__/PathHandling.test.js14 symbols
packages/core/src/StateUtils.js14 symbols

Dependencies from manifests, versioned

@babel/plugin-proposal-class-properties7.12.1 · 1×
@babel/plugin-proposal-optional-chaining7.12.1 · 1×
@babel/preset-env7.12.1 · 1×
@babel/preset-react7.12.1 · 1×
@babel/preset-typescript7.12.1 · 1×
@babel/runtime7.12.1 · 1×
@commitlint/config-conventional11.0.0 · 1×
@expo/vector-icons10.0.0 · 1×
@react-native-community/bob0.16.2 · 1×
@react-native-community/masked-view0.1.10 · 1×
@react-navigation/core3.7.9 · 1×
@react-navigation/native3.8.4 · 1×

For agents

$ claude mcp add react-navigation \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact