Satyajit Sahoo 15b8bb3458 feat: add a way to specify an unique ID for screens
With this, the user will be able to specify a `getId` function for their screens which returns an unique ID to use for the screen:

```js
<Stack.Screen
  name="Profile"
  component={ProfileScreen}
  getId={({ params }) => params.userId}
/>
```

This is an alternative to the `key` option in `navigate` with several advantages:

- Often users specify a key that's dependent on data already in params, such as `userId`. So it's much easier to specify it one place rather than at every call site.
- Users won't need to deal with generating a unique key for routes manually.
- This will work with other actions such as `push`, and not just navigate.
- With this, it'll be possible to have multiple instances of the screen even if you use `navigate`, which may be desirable in many cases (such as profile screens).
2021-01-14 03:33:44 +01:00
2020-10-25 01:28:19 +02:00
2020-11-29 17:56:21 +01:00
2020-02-10 16:04:20 +01:00
2021-01-08 13:59:24 +01:00
2020-03-22 23:58:06 +01:00
2020-11-17 20:36:06 +01:00
2020-02-10 16:04:20 +01:00
2020-02-19 23:30:12 +01:00
2020-11-11 22:07:33 +01:00
2020-04-12 22:11:22 +02:00
2021-01-08 13:59:24 +01:00
2020-06-22 16:23:20 +02:00
2021-01-08 13:59:24 +01:00

React Navigation 5

Build Status Code Coverage MIT License

Routing and navigation for your React Native apps.

Documentation can be found at reactnavigation.org.

If you are looking for version 4, the code can be found in the 4.x branch.

Package Versions

Name Latest Version
@react-navigation/core badge
@react-navigation/native badge
@react-navigation/routers badge
@react-navigation/stack badge
@react-navigation/drawer badge
@react-navigation/material-top-tabs badge
@react-navigation/material-bottom-tabs badge
@react-navigation/bottom-tabs badge
@react-navigation/devtools badge

Contributing

Please read through our contribution guide to get started!

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.

Description
No description provided
Readme 46 MiB
Languages
TypeScript 97.9%
Java 0.8%
JavaScript 0.6%
Objective-C 0.4%
Starlark 0.2%