Skip to content
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

Commit e11d7b1

Browse files
committed
Update
1 parent e5e4c49 commit e11d7b1

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

README.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ npx react-native run-android
2020

2121
## Example code
2222

23-
**App.js**
23+
**Appv4.js**
2424

2525
```js
2626
import {createAppContainer} from 'react-navigation';
27-
import {createSharedElementStackNavigator} from 'react-navigation-shared-element';
27+
import {createSharedElementStackNavigator4} from 'react-navigation-shared-element';
2828
import {enableScreens} from 'react-native-screens';
2929
import {MainScreen} from './MainScreen';
3030
import {DetailScreen} from './DetailScreen';
@@ -33,7 +33,7 @@ import {springyFadeIn} from './transitions';
3333
enableScreens();
3434

3535
// Instead of calling `createStackNavigator`, wrap it using `createSharedElementStackNavigator`
36-
const StackNavigator = createSharedElementStackNavigator(
36+
const StackNavigator = createSharedElementStackNavigator4(
3737
{
3838
Main: MainScreen,
3939
Detail: DetailScreen,
@@ -115,19 +115,9 @@ export const DetailScreen = ({navigation}) => (
115115
// The `sharedElements` function is called whenever you navigate
116116
// to or from this screen. You can use the provided navigation
117117
// states or trigger or disable animations.
118-
DetailScreen.sharedElements = (navigation, otherNavigation, showing) => [
118+
DetailScreen.sharedElements = (route, otherRoute, showing) => [
119119
{id: 'image'},
120120
{id: 'text', animation: 'fade'},
121121
];
122122
```
123123

124-
## Libraries used
125-
126-
- react-native@0.61.4
127-
- react-navigation@4.0.10
128-
- react-navigation-stack@2.1.1
129-
- react-navigation-tabs@2.7.0
130-
- react-navigation-shared-element@2.0.1
131-
- react-native-shared-element@0.5.6
132-
- react-native-gesture-handler@1.5.3
133-
- react-native-screens@2.0.0-beta.2

src/DetailScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ DetailScreen.navigationOptions = {
4747
// The `sharedElements` function is called whenever you navigate
4848
// to or from this screen. You can use the provided navigation
4949
// states or trigger or disable animations.
50-
DetailScreen.sharedElements = (navigation, otherNavigation, showing) => [
50+
DetailScreen.sharedElements = (route, otherRoute, showing) => [
5151
{id: 'image'},
5252
{id: 'text', animation: 'fade'},
5353
];

src/ModalScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ ModalScreen.navigationOptions = {
8686
// The `sharedElements` function is called whenever you navigate
8787
// to or from this screen. You can use the provided navigation
8888
// states or trigger or disable animations.
89-
ModalScreen.sharedElements = (navigation, otherNavigation, showing) => [
89+
ModalScreen.sharedElements = (route, otherRoute, showing) => [
9090
{id: 'image'},
9191
{id: 'text', animation: 'fade'},
9292
];

0 commit comments

Comments
 (0)