We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2e940f3 commit 19c2a3eCopy full SHA for 19c2a3e
README.md
@@ -41,13 +41,22 @@ import { SharedElement } from 'react-navigation-sharedelement';
41
class ListScreen extends React.Component {
42
renderItem(item) {
43
return (
44
- <TouchableOpacity onPress={() => this.props.navigation.push('Detail', {sharedElements: [`itemPhoto.${item.id}`]})}
+ <TouchableOpacity onPress={() => this.onPressItem(item)}>
45
<SharedElement id={`itemPhoto.${item.id}`}>
46
<Image source={...} />
47
</SharedElement>
48
</TouchableOpacity>
49
)
50
}
51
+
52
+ onPressItem(item) {
53
+ const { navigation } = this.props;
54
+ navigation.push('Detail', {
55
+ sharedElements: [
56
+ `itemPhoto.${item.id}`
57
+ ]
58
+ });
59
+ }
60
61
```
62
0 commit comments