mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-30 05:15:25 +08:00
feat: compatibility layer
This commit is contained in:
committed by
Satyajit Sahoo
parent
438692d661
commit
e0f28a432d
28
packages/compat/README.md
Normal file
28
packages/compat/README.md
Normal file
@@ -0,0 +1,28 @@
|
||||
# `@react-navigation/compat`
|
||||
|
||||
Compatibility layer to write navigator definitions in static configuration format.
|
||||
|
||||
## Installation
|
||||
|
||||
Open a Terminal in your project's folder and run,
|
||||
|
||||
```sh
|
||||
yarn add @react-navigation/core @react-navigation/compat
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
import { createCompatNavigatorFactory } from '@react-navigation/compat';
|
||||
import { createStackNavigator } from '@react-navigation/stack';
|
||||
|
||||
const RootStack = createCompatNavigatorFactory(createStackNavigator)(
|
||||
{
|
||||
Home: { screen: HomeScreen },
|
||||
Profile: { screen: ProfileScreen },
|
||||
},
|
||||
{
|
||||
initialRouteName: 'Profile',
|
||||
}
|
||||
);
|
||||
```
|
||||
Reference in New Issue
Block a user